0

请问Maven多模块项目在CentOS使用Maven打包出现异常:'parent.relativePath' points at wrong local POM
如何解决

我已经百度了一整天了,各种方法都试过了

这个工程在Windows下使用Maven命令打包就没问题,到了CentOS下就打包不了……很着急啊

错误日志:

[ERROR]   The project com.dreamworkstoys:saas-lemeng-b2b-service:0.0.1-SNAPSHOT (/root/git-repository/saas-b2b/saas-lemeng-b2b-service/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not find artifact com.dreamworkstoys:saas-lemeng-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.dreamworkstoys:saas-lemeng-parent:pom:0.0.1-SNAPSHOT
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:195)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:244)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:899)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:751)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:309)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:463)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:432)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:549)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:432)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:396)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:672)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:663)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:253)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.dreamworkstoys:saas-lemeng-parent:pom:0.0.1-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:191)
    ... 24 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.dreamworkstoys:saas-lemeng-parent:pom:0.0.1-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:434)
    ... 28 more
[ERROR]

查看全部 2 个回答

0

已采纳

你的项目继承 com.dreamworkstoys:saas-lemeng-parent:pom:0.0.1-SNAPSHOT ,而这个项目又是你自己的,你在 Windows 平台下应该对 saas-lemeng-parent 运行了 mvn install 命令安装到了本地仓库中,所以没有问题,而 CentOS 中没有安装这个项目,所以显示找不到这个包,在 CentOS 安装一遍就行了