运行mvn install出现Error building POM (may not be this project's POM)错误
qvb1999
2010-08-18
本人是maven初学者,遇到一个问题,运行mvn install出错!请指点一二!谢谢! D:\mvntest>mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch04 -DartifactId=simple-weather -DpackageName=org.sonatype.mavenbook -Dversion=1.0
运行完后,修改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> <artifactId>simple-weather</artifactId> <packaging>jar</packaging> <name>Chapter 4 Simple Weather Project</name> <url>http://sonatype.com/book</url> <licenses> <license> <name>Apache 2</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> <organization> <name>Sonatype</name> <url>http://www.sonatype.com</url> </organization> <parent> <artifactId>parent</artifactId> <groupId>org.sonatype.mavenbook.ch04</groupId> <version>1-SNAPSHOT</version> </parent> <developers> <developer> <id>jason</id> <name>Jason Van Zyl</name> <email>jason@maven.org</email> <url>http://www.sonatype.com</url> <organization>Sonatype</organization> <organizationUrl>http://www.sonatype.com</organizationUrl> <roles> <role>developer</role> </roles> <timezone>-6</timezone> </developer> </developers> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>org.sonatype.mavenbook.weather.Main</mainClass> <addClasspath>true</addClasspath> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <testFailureIgnore>true</testFailureIgnore> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>velocity</groupId> <artifactId>velocity</artifactId> <version>1.5</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>1.3.2</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
D:\mvntest\>cd simple-weather D:\mvntest\simple-weather>mvn install
Reason: Cannot find parent: org.sonatype.mavenbook.ch04:parent for project: null
at org.codehaus.classworlds.Launcher.main(Launcher.java:375) org.sonatype.mavenbook.ch04:parent:pom:2-SNAPSHOT from the specified remote repositories: for project org.sonatype.mavenbook.ch04:parent org.sonatype.mavenbook.ch04:parent:pom:2-SNAPSHOT from the specified remote repositories:
一直在找寻问题所在,但由于是新手,而且在maven权威指南的demo是没有错的,可一直不知道为什么错,错在哪里! |
|
qvb1999
2010-08-18
自己搞定了,原来demo给的parent出了问题!唉!浪费我时间
|
|
yulu9339
2010-09-30
什么原因说明下呀……
|
|
lvgang
2010-09-30
缺少 groupId 和 version 元素
|
相关讨论
相关资源推荐
- Python接口自动化测试框架(番外篇)-- 代码质量管理sonar
- 持续集成之②:整合jenkins与代码质量管理平台Sonar并实现构建失败邮件通知
- DEVOPS技术实践_05:sonar静态代码扫描
- 代码质量管理工具-SonarQube
- Android (Android Studio) 中使用Sonar进行代码质量分析
- SonarQube(Sonar)服务器在windows下的安装和部署
- 使用Sonar踩过的坑
- sonar mysql 5.5_SonarQube代码质量管理工具安装与使用(sonarqube5.1.2 + sonar-runner-dist-2.4 + MySQL5.x)...
- sonar php插件,sonar: SonarQube 是一个用于管理源码质量的平台,帮助开发者编写干净的代码,其支持的语言包括:Java、PHP、C#、C、Cobol、PL/SQL 与 Flex ...
- 自动化工具之Sonar