无法使用MAVEN和错误进行构建-org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目上执行目标

时间:2019-04-12 13:41:55

标签: java eclipse spring-boot eclipse-plugin

我一直在尝试使用Springtools构建代码。但是我陷入了一个错误。

我的系统配置如maven所示:

>Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T15:49:05-04:00)
>Maven home: C:\Users\Felipe\Documents\Proyecto\backend\module-ebs\EMBEDDED
Java version: 1.8.0_201, vendor: Oracle Corporation
>Java home: C:\Program Files\Java\jre1.8.0_201
>Default locale: en_US, platform encoding: Cp1252
>OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

以下是该错误的Maven跟踪:

  

[错误]无法在项目模块ebs上执行目标:无法解决>项目com.mexperience的依赖关系:模块ebs:jar:0.0.1-SNAPSHOT:找不到工件com.mexperience:module-核心:jar:0.0.1-SNAPSHOT-> [帮助1]   org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目模块ebs上执行>目标:无法解析项目> com的依赖项。mexperience:module-ebs:jar:0.0.1-SNAPSHOT:找不到工件> com .mexperience:模块核心:jar:0.0.1-SNAPSHOT       在> org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:269)       在> org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:147)       在> org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:246)       在> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)       在> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)       在> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)       在> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)       在> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)       在> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)       在> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)       在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)       在org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)       在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)       在org.apache.maven.cli.MavenCli.main(MavenCli.java:194)       在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处       在sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)       在sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)       在java.lang.reflect.Method.invoke(未知来源)       在> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)       在> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)       在> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)       在> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)   引起原因:org.apache.maven.project.DependencyResolutionException:无法解析项目com.mexperience的依赖项:module-ebs:jar:0.0.1-SNAPSHOT:找不到工件com.mexperience:module-core:jar:0.0 .1-快照       在> org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:208)       在> org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:243)       ...另外23个   由以下原因引起:org.eclipse.aether.resolution.DependencyResolutionException:找不到工件com.mexperience:module-core:jar:0.0.1-SNAPSHOT       在> org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:355)       在> org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:202)       ...另外24个   引起原因:org.eclipse.aether.resolution.ArtifactResolutionException:找不到工件com.mexperience:module-core:jar:0.0.1-SNAPSHOT       在> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)       在> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)       在> org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338)       ...另外25个   引起原因:org.eclipse.aether.transfer.ArtifactNotFoundException:找不到工件com.mexperience:module-core:jar:0.0.1-SNAPSHOT       在> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:412)       ...另外27个   [错误]   [错误]   [ERROR]有关错误和可能的解决方案的详细信息,请>阅读以下文章:   [错误] [帮助1]> http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

这是pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0     pom

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.mexperience</groupId>
<artifactId>backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>backend</name>

<modules>
    <module>module-core</module>
    <module>module-ebs</module>
    <module>module-resource</module>
</modules>

<properties>
    <java.version>1.8</java.version>
    <maven.test.skip>true</maven.test.skip>
    <docker.registry>docker.mexperiencia.io</docker.registry>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.mexperience</groupId>
            <artifactId>module-core</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.mexperience</groupId>
            <artifactId>module-ebs</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.mexperience</groupId>
            <artifactId>module-resource</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--Docker-->
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.27.2</version>
                <extensions>true</extensions>
                <configuration>
                    <images>
                        <image>
                            <name>${docker.registry}/${project.groupId}.${project.artifactId}</name>
                            <build>
                                <from>openjdk:8-alpine</from>
                                <tags>
                                    <tag>latest</tag>
                                </tags>
                                <env>
                                </env>
                                <entryPoint>
                                    <exec>
                                        <arg>java</arg>
                                        <arg>-jar</arg>
                                        <arg>-Xmx768m</arg>
                                        <arg>-Xms768m</arg>
                                        <arg>/root/${project.build.finalName}.jar</arg>
                                    </exec>
                                </entryPoint>
                                <assembly>
                                    <targetDir>/root</targetDir>
                                    <mode>dir</mode>
                                    <descriptorRef>artifact</descriptorRef>
                                </assembly>
                                <ports>
                                    <port>8080</port>
                                </ports>
                            </build>
                            <run>
                                <!--<memory>1073741824</memory>-->
                                <!--<volumes>-->
                                <!--<bind>-->
                                <!--<volume></volume>-->
                                <!--</bind>-->
                                <!--</volumes>-->
                            </run>
                        </image>
                    </images>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<!--    <repositories>-->
<!--        <repository>-->
<!--            <id>project-repository</id>-->
<!--            <url>file://${project.basedir}/.project-repository</url>-->
<!--        </repository>-->
<!--    </repositories>-->

我遵循本文中指示的说明:  https://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

但是没有用。我还执行了mvn clean install,但也不起作用。

我能做什么=?

0 个答案:

没有答案