未能执行目标 Maven/Eclipse
Failed to execute goal Maven/Eclipse
好的,我是 Maven 和 Eclipse 的新手,我必须 运行 现有项目。我正在尝试使用命令 eclipse:eclipse -Dwtpversion=2.0
但它向我显示以下错误:
[INFO] Adding support for WTP version 2.0.
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.261 s
[INFO] Finished at: 2018-04-05T10:36:20-03:00
[INFO] Final Memory: 9M/88M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (default-cli) on project core-framework: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1]
我已经在 this question 上尝试了所有可能的解决方案,但没有奏效。我的 POM 是:
<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.com.empresa1</groupId>
<artifactId>e1-framework-utils</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>e1-framework-utils</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.log4j>2.8.2</version.log4j>
<version.junit>4.12</version.junit>
<version.commonslang>3.3.2</version.commonslang>
<version.freemaker>2.3.23</version.freemaker>
<version.resteasey-multipart>3.0.11.Final</version.resteasey-multipart>
<version.commonscollections>3.2.2</version.commonscollections>
<version.zip4j>1.3.2</version.zip4j>
<version.core-framerwork>2.2.0</version.core-framerwork>
<!-- <version.test-core-framerwork>2.2.0</version.test-core-framerwork>-->
</properties>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://localhost:9000
</sonar.host.url>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<!-- Always download and attach dependencies source code -->
<!-- <downloadSources>false</downloadSources>
<downloadJavadocs>false</downloadJavadocs>-->
<!-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 -->
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<testSource>1.7</testSource>
<testTarget>1.7</testTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
</dependency>
<dependency>
<groupId>br.com.empresa1</groupId>
<artifactId>core-framework</artifactId>
<version>${version.core-framerwork}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${version.log4j}</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${version.freemaker}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
<version>${version.resteasey-multipart}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${version.commonslang}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${version.commonscollections}</version>
</dependency>
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>-->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</project>
任何帮助都是有用的
正如@JFMeier 在评论中所说,命令 eclipse:eclipse 现已弃用。
要更新项目,右击项目,select Maven -> 更新项目... -> 勾选强制更新Snapshots/Release 并单击 确定。
那就行了。
好的,我是 Maven 和 Eclipse 的新手,我必须 运行 现有项目。我正在尝试使用命令 eclipse:eclipse -Dwtpversion=2.0
但它向我显示以下错误:
[INFO] Adding support for WTP version 2.0.
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.261 s
[INFO] Finished at: 2018-04-05T10:36:20-03:00
[INFO] Final Memory: 9M/88M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (default-cli) on project core-framework: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse failed: For artifact {null:null:null:jar}: The groupId cannot be empty. -> [Help 1]
我已经在 this question 上尝试了所有可能的解决方案,但没有奏效。我的 POM 是:
<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.com.empresa1</groupId>
<artifactId>e1-framework-utils</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>e1-framework-utils</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.log4j>2.8.2</version.log4j>
<version.junit>4.12</version.junit>
<version.commonslang>3.3.2</version.commonslang>
<version.freemaker>2.3.23</version.freemaker>
<version.resteasey-multipart>3.0.11.Final</version.resteasey-multipart>
<version.commonscollections>3.2.2</version.commonscollections>
<version.zip4j>1.3.2</version.zip4j>
<version.core-framerwork>2.2.0</version.core-framerwork>
<!-- <version.test-core-framerwork>2.2.0</version.test-core-framerwork>-->
</properties>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://localhost:9000
</sonar.host.url>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<!-- Always download and attach dependencies source code -->
<!-- <downloadSources>false</downloadSources>
<downloadJavadocs>false</downloadJavadocs>-->
<!-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 -->
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
<testSource>1.7</testSource>
<testTarget>1.7</testTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
</dependency>
<dependency>
<groupId>br.com.empresa1</groupId>
<artifactId>core-framework</artifactId>
<version>${version.core-framerwork}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${version.log4j}</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${version.freemaker}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
<version>${version.resteasey-multipart}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${version.commonslang}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${version.commonscollections}</version>
</dependency>
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>-->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</project>
任何帮助都是有用的
正如@JFMeier 在评论中所说,命令 eclipse:eclipse 现已弃用。
要更新项目,右击项目,select Maven -> 更新项目... -> 勾选强制更新Snapshots/Release 并单击 确定。
那就行了。