我试图在 Windows XP 中生成 maven 项目。
我创建了文件夹pom.xml
:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>selenium.web.driver</groupId>
<artifactId>OMS_selenium_Test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>selenium_tests</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<scope></scope>
</dependency>
</dependencies>
</project>
打开cmd
并进入此文件夹。
运行下一个命令:
C:\Documents and Settings\Admintemp\maven_test>mvn archetype:generate -DgroupId=
selenium.web.driver -DartifactId=OMS_selenium_Test -Dversion=1.0-SNAPSHOT -Dinte
ractiveMode=false
我没有使用这些数据生成项目,而是发现了下一个错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:generate (default-cli) on project OMS_selenium_Test: Unable to add module to
the current project as it is not of packaging type 'pom' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
为什么会发生这种情况?也许我想念smt,但我无法弄清楚究竟是什么......
- 如何解决这个麻烦并用maven生成项目?