在我将Ubuntu升级到13.10版本后,我重新安装了最新的Eclipse Kepler。
我有一个简单的JSE应用程序。以前它曾经在Eclipse中工作,它仍在通过终端(mvn clean install)工作,但现在我在Eclipse中遇到错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar
(default-jar) on project files: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar
failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-jar-plugin:2.3.2'.
A required class is missing: org.apache.maven.plugin.jar.JarMojo
我已经尝试了一些事情:
不幸的是没有用。
这是我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>br.uel.ati.util</groupId>
<artifactId>files</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jse-template</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<description>Template da Diretoria de Desenvolvimento de Sistemas para bibliotecas utilizadas por projetos EJB e Web.</description>
<organization>
<name>Universidade Estadual de Londrina</name>
<url>http://uel.br/ati</url>
</organization>
</project>
任何人都知道我应该尝试解决这个问题吗?
我在此处找到了解决方案: How can i resolve plugin problem in maven:' Unable to load mojo'
显然maven存储库中存在损坏的库。我刚刚删除了repository / org文件夹,再次下载并更新了(Maven-&gt; Update Project + F5)我在Eclipse中的maven项目。
我仍然很好奇为什么它是通过命令行工作的。当我通过apt-get安装它时,可能会创建一个新的maven存储库。