Maven:从元素'组织'开始发现无效内容。

时间:2016-07-07 17:29:17

标签: java maven pom.xml

我已经从GitHub下载了一个java项目,我正在尝试编译它。

我在pom.xml文件中有错误,我在互联网上搜索过一个解决方案似乎有谁遇到了同样的问题,但有其他元素。

错误是

cvc-complex-type.2.4.a: Invalid content was found starting with element 'organisation'. 
One of '{"http://maven.apache.org/POM/4.0.0":parent,
"http://maven.apache.org/POM/4.0.0":name,
"http://maven.apache.org/POM/4.0.0":description, 
"http://maven.apache.org/POM/4.0.0":prerequisites,
"http://maven.apache.org/POM/4.0.0":issueManagement, 
"http://maven.apache.org/POM/4.0.0":ciManagement, 
"http://maven.apache.org/POM/4.0.0":inceptionYear,
"http://maven.apache.org/POM/4.0.0":mailingLists, 
"http://maven.apache.org/POM/4.0.0":developers, 
"http://maven.apache.org/POM/4.0.0":contributors, 
"http://maven.apache.org/POM/4.0.0":licenses, 
"http://maven.apache.org/POM/4.0.0":scm, 
"http://maven.apache.org/POM/4.0.0":organization, 
"http://maven.apache.org/POM/4.0.0":build, 
"http://maven.apache.org/POM/4.0.0":profiles, 
"http://maven.apache.org/POM/4.0.0":modules, 
"http://maven.apache.org/POM/4.0.0":repositories, 
"http://maven.apache.org/POM/4.0.0":pluginRepositories,
"http://maven.apache.org/POM/4.0.0":dependencies, 
"http://maven.apache.org/POM/4.0.0":reports,
"http://maven.apache.org/POM/4.0.0":reporting, 
"http://maven.apache.org/POM/4.0.0":dependencyManagement,
"http://maven.apache.org/POM/4.0.0":distributionManagement,
"http://maven.apache.org/POM/4.0.0":properties}' 
is expected.

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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>nz.ac.waikato.modeljunit</groupId>
  <artifactId>modeljunit-projects</artifactId>
  <version>2.6-SNAPSHOT</version>
  <packaging>pom</packaging>
  <url>http://modeljunit.sourceforge.net</url>
  <organisation>
    <name>ModelJUnit Projects</name>
    <url>http://modeljunit.sourceforge.net</url>
  </organisation>
  <issueManagement>
    <url>http://sourceforge.net/p/modeljunit/bugs/?source=navbar</url>
  </issueManagement>
  <licenses>
    <license>
      <name>GPL Version 3.0</name>
      <url>http://www.gnu.org/copyleft/gpl.txt</url>
    </license>
  </licenses>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
  <scm>
    <connection>scm:svn:http://svn.code.sf.net/p/modeljunit/code/trunk
    </connection>
    <developerConnection>scm:svn:svn+ssh://svn.code.sf.net/p/modeljunit/code/trunk
    </developerConnection>
    <url>http://svn.code.sf.net/p/modeljunit/code/trunk</url>
  </scm>
  <developers>
    <developer>
      <id>marku</id>
      <name>Mark Utting</name>
      <email>marku@cs.waikato.ac.nz</email>
    </developer>
  </developers>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <modules>
    <module>modeljunit</module>
    <module>paramedit</module>
  </modules>
  </project>

1 个答案:

答案 0 :(得分:0)

输入错误,您应该使用organization(NOT organi s )标记:

<organization>
  <name>ModelJUnit Projects</name>
  <url>http://modeljunit.sourceforge.net</url>
</organization>