Java 无法执行目标Maven/Eclipse

Java 无法执行目标Maven/Eclipse,java,eclipse,maven,pom.xml,Java,Eclipse,Maven,Pom.xml,好的,我是Maven和Eclipse的新手,我必须运行一个现有的项目。我试图使用命令eclipse:eclipse-Dwtpversion=2.0,但它显示了以下错误: [信息]添加对WTP 2.0版的支持。 [信息]使用Eclipse工作区:null [信息]添加默认类路径容器:org.eclipse.jdt.launching.JRE\u container [信息]---------------------------------------------------------------

好的,我是Maven和Eclipse的新手,我必须运行一个现有的项目。我试图使用命令eclipse:eclipse-Dwtpversion=2.0,但它显示了以下错误:

[信息]添加对WTP 2.0版的支持。
[信息]使用Eclipse工作区:null
[信息]添加默认类路径容器:org.eclipse.jdt.launching.JRE\u container
[信息]----------------------------------------------------------------
[信息]生成失败
[信息]----------------------------------------------------------------
[信息]总时间:17.261秒
[信息]完成时间:2018-04-05T10:36:20-03:00
[信息]最终内存:9M/88M
[信息]----------------------------------------------------------------
[错误]未能在项目核心框架上执行目标org.apache.maven.plugins:maven eclipse插件:2.9:eclipse(默认cli):执行目标org.apache.maven.plugins的默认cli:maven eclipse插件:2.9:eclipse失败:对于工件{null:null:null:jar}:groupId不能为空。->[帮助1]

我尝试了所有可能的解决方案,但都没有成功。我的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>

4.0.0
br.com.empresa1
e1框架UTIL
1.1.0
罐子
e1框架UTIL
http://maven.apache.org
pentaho释放
http://repository.pentaho.org/artifactory/repo/
UTF-8
UTF-8
2.8.2
4.12
3.3.2
2.3.23
3.0.11.1最终版本
3.2.2
1.3.2
2.2.0
声纳
真的
http://localhost:9000
org.apache.maven.plugins
maven eclipse插件
2.9
2
maven编译器插件
3.1
1.7
1.7
1.7
1.7
1.7
org.sonarsource.scanner.maven
声纳maven插件
3.0.1
朱尼特
朱尼特
${version.junit}
br.com.empresa1
核心框架
${version.core framework}
org.apache.logging.log4j
log4j型芯
${version.log4j}
org.freemarker
自由标记
${version.freemaker}
org.jboss.resteasy
resteasy多部分提供程序
${version.resteasy multipart}
org.apache.commons
commons-lang3
${version.commonslang}
公地收藏
公地收藏
${version.commonCollections}
net.lingala.zip4j
zip4j
1.3.2

任何帮助都是有用的

正如@JFMeier在评论中所说的,eclipse:eclipse命令现在已经不推荐使用了

要更新项目,右键单击项目,选择Maven->更新项目…->选中强制更新快照/发布框,然后单击确定


那就可以了。

readhere
eclipse:eclipse
是一个不推荐使用的命令,不应该再使用了。如果您使用Maven和Eclipse,请通过m2e创建一个新的Eclipse项目。文件->新建->项目。。然后选择Maven项目。按照@JFMeier的建议操作,因为该项目已退役。@JFMeier,谢谢你的提示!要运行您的项目,请在项目目录下运行mvneclipse:eclipse。