Unable to create maven project from my archetype

I develop projects in Eclipse and I use maven, so I created a new archetype using the "maven-archetype-archetype" Archetype , but as soon as I try to create a new project with my new archetype, I get the following error message in Eclipse:

The META-INF/maven/archetype.xml descriptor cannot be found.

Any idea what could be the reason?

Update:

My archetype.xml file:

<archetype>
    <id>test-archetype</id>
    <sources>
        <source>src/</source>
    </sources>
    <testSources>
        <source>test/</source>
    </testSources>
</archetype>

My pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>$my.group.id</groupId>
    <artifactId>$test-archetype</artifactId>
    <version>$0.0.1</version>


    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

The folder structure is described as follows:

archetype
|-- pom.xml
`-- src
    `-- main
        `-- resources
            |-- META-INF
            |   `-- maven
            |       `--archetype.xml
            `-- archetype-resources
                |-- pom.xml
                `-- src
                `-- test    

Adam.

+3
source share
5 answers

, , Maven, , , , , Eclipse , , .

-1

, Eclipse , archetype.xml , . , , Eclipse. , / Eclipse, , , .

+4

, ( Eclipse), -, "mvn archetype: create" , .

"mvn archetype: generate"

. http://maven.apache.org/archetype/maven-archetype-plugin/plugin-info.html

+2

Eclipse, Eclipse IAM, maven eclipse.

0

, -, , Maven eclipse. , eclipse.

:

  • (, 0.0.1-SNAPSHOT 0.0.2-SNAPSHOT). mvn Workspace, .

  • . .

0

Source: https://habr.com/ru/post/1789119/


All Articles