【发布时间】:2011-01-31 23:25:20
【问题描述】:
我正在 Eclipse 中开发项目并且我正在使用 maven,所以我创建了一个新原型,使用 'maven-archetype-archetype' Archetype ,但是一旦我尝试使用我的新原型创建一个新项目,我会在 Eclipse 中收到以下错误消息:
The META-INF/maven/archetype.xml descriptor cannot be found.
知道原因是什么吗?
更新:
我的archetype.xml 文件:
<archetype>
<id>test-archetype</id>
<sources>
<source>src/</source>
</sources>
<testSources>
<source>test/</source>
</testSources>
</archetype>
我的 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>
文件夹结构如下:
archetype
|-- pom.xml
`-- src
`-- main
`-- resources
|-- META-INF
| `-- maven
| `--archetype.xml
`-- archetype-resources
|-- pom.xml
`-- src
`-- test
亚当。
【问题讨论】:
-
项目创建是否从命令行工作?
-
是的,这是为什么呢?
-
我也更新了 Eclipse maven 插件,但是还是不行...
标签: eclipse maven maven-plugin maven-archetype