2014-07-12 51 views
2

我正在尝试从eclipse创建一个新的Maven项目。我在我的pom.xml中遇到了这个错误。Eclipse Maven错误:pom编辑器中的org.apache.maven.plugin.jar.JarMojo错误

org.apache.maven.plugin.jar.JarMojo 

我试图无处不在。我发现了一个stackoverflow问题How to remove org.apache.maven.plugin.jar.JarMojo error from pom editor 但我无法摆脱这个错误。

任何人都可以帮助我吗?

我真的很抱歉,如果我问一些愚蠢的东西。但我完全卡住了。可能是我错过了一些东西。 我使用Maven 3.0.5

这是我的pom.xml

<?xml version="1.0"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>123</groupId> 
    <artifactId>test</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>test name</name> 
    <description>test desc</description> 
    <repositories> 
    <repository> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>http://repo.maven.apache.org/maven2</url> 
    </repository> 
    </repositories> 
    <pluginRepositories> 
    <pluginRepository> 
     <releases> 
     <updatePolicy>never</updatePolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>http://repo.maven.apache.org/maven2</url> 
    </pluginRepository> 
    </pluginRepositories> 
    <build> 
    <sourceDirectory>C:\harish\RestApi\spring-jersey\test\src\main\java</sourceDirectory> 
    <scriptSourceDirectory>C:\harish\RestApi\spring-jersey\test\src\main\scripts</scriptSourceDirectory> 
    <testSourceDirectory>C:\harish\RestApi\spring-jersey\test\src\test\java</testSourceDirectory> 
    <outputDirectory>C:\harish\RestApi\spring-jersey\test\target\classes</outputDirectory> 
    <testOutputDirectory>C:\harish\RestApi\spring-jersey\test\target\test-classes</testOutputDirectory> 
    <resources> 
     <resource> 
     <directory>C:\harish\RestApi\spring-jersey\test\src\main\resources</directory> 
     </resource> 
    </resources> 
    <testResources> 
     <testResource> 
     <directory>C:\harish\RestApi\spring-jersey\test\src\test\resources</directory> 
     </testResource> 
    </testResources> 
    <directory>C:\harish\RestApi\spring-jersey\test\target</directory> 
    <finalName>test-0.0.1-SNAPSHOT</finalName> 
    <pluginManagement> 
     <plugins> 
     <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <version>1.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2-beta-5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.1</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-release-plugin</artifactId> 
      <version>2.0</version> 
     </plugin> 
     </plugins> 
    </pluginManagement> 
    <plugins> 
     <plugin> 
     <artifactId>maven-clean-plugin</artifactId> 
     <version>2.4.1</version> 
     <executions> 
      <execution> 
      <id>default-clean</id> 
      <phase>clean</phase> 
      <goals> 
       <goal>clean</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-install-plugin</artifactId> 
     <version>2.3.1</version> 
     <executions> 
      <execution> 
      <id>default-install</id> 
      <phase>install</phase> 
      <goals> 
       <goal>install</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-resources-plugin</artifactId> 
     <version>2.5</version> 
     <executions> 
      <execution> 
      <id>default-resources</id> 
      <phase>process-resources</phase> 
      <goals> 
       <goal>resources</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>default-testResources</id> 
      <phase>process-test-resources</phase> 
      <goals> 
       <goal>testResources</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.10</version> 
     <executions> 
      <execution> 
      <id>default-test</id> 
      <phase>test</phase> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.3.2</version> 
     <executions> 
      <execution> 
      <id>default-testCompile</id> 
      <phase>test-compile</phase> 
      <goals> 
       <goal>testCompile</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>default-compile</id> 
      <phase>compile</phase> 
      <goals> 
       <goal>compile</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-jar-plugin</artifactId> 
     <version>2.3.2</version> 
     <executions> 
      <execution> 
      <id>default-jar</id> 
      <phase>package</phase> 
      <goals> 
       <goal>jar</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-deploy-plugin</artifactId> 
     <version>2.7</version> 
     <executions> 
      <execution> 
      <id>default-deploy</id> 
      <phase>deploy</phase> 
      <goals> 
       <goal>deploy</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-site-plugin</artifactId> 
     <version>3.0</version> 
     <executions> 
      <execution> 
      <id>default-site</id> 
      <phase>site</phase> 
      <goals> 
       <goal>site</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>C:\harish\RestApi\spring-jersey\test\target\site</outputDirectory> 
       <reportPlugins> 
       <reportPlugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-project-info-reports-plugin</artifactId> 
       </reportPlugin> 
       </reportPlugins> 
      </configuration> 
      </execution> 
      <execution> 
      <id>default-deploy</id> 
      <phase>site-deploy</phase> 
      <goals> 
       <goal>deploy</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>C:\harish\RestApi\spring-jersey\test\target\site</outputDirectory> 
       <reportPlugins> 
       <reportPlugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-project-info-reports-plugin</artifactId> 
       </reportPlugin> 
       </reportPlugins> 
      </configuration> 
      </execution> 
     </executions> 
     <configuration> 
      <outputDirectory>C:\harish\RestApi\spring-jersey\test\target\site</outputDirectory> 
      <reportPlugins> 
      <reportPlugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-project-info-reports-plugin</artifactId> 
      </reportPlugin> 
      </reportPlugins> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    <reporting> 
    <outputDirectory>C:\harish\RestApi\spring-jersey\test\target\site</outputDirectory> 
    </reporting> 
</project> 

更新: 我重新做了Maven安装。我没有得到这个例外。 我认为eclipse使用的maven版本和我下载的版本有问题。 我将它标记为How to remove org.apache.maven.plugin.jar.JarMojo error from pom editor

+0

什么是确切的错误信息? –

+0

没有错误消息。但是,这个消息在RED中是“org.apache.maven.plugin.jar.JarMojo”。 屏幕快照也在http://stackoverflow.com/questions/14767631/how-to-remove-org-apache-maven-plugin-jar-jarmojo-error-from-pom-editor中共享 – Roger

回答

3

删除[user dir] /。m2/repository/org/apache/maven并清理所有项目。