所以我有一个企业存储库,那里有已经部署的主POM。现在我有其他项目,我需要单独安装,但他们有父pom。
每当我进行mvn清理安装时,我都无法找到父pom的工件。
我的本地设置。xml为central定义了镜像,因为我假设maven首先尝试在relativePath中搜索父pom,然后是本地repo,最后是远程repo。父POM具有所有提到的存储库和分发详细信息,因此其他项目或本地设置中不存在这些回购信息。xml。
我的设置。xml
<mirrors>
<mirror>
<id>nexus3</id>
<name>my repo</name>
<url>https://repository.XYZ.com/repository/maven-all/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<servers>
<server>
<id>nexus3</id>
<username>userid</username>
<password>pwd</password>
</server>
<server>
<id>nexus3-legacy-releases</id>
<username>userid</username>
<password>pwd</password>
</server>
<server>
<id>nexus3-legacy-snapshots</id>
<username>userid</username>
<password>pwd</password>
</server>
</servers>
波姆。xml
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.xyz.sample</groupId>
<artifactId>xyz-par-pom</artifactId>
<version>1.1.10-SNAPSHOT</version>
</parent>
<artifactId>ds-sample</artifactId>
<packaging>jar</packaging>
<name>sample project</name>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.8</version>
<configuration>
<reportVersion>2.3.4</reportVersion>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources-filtered</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
错误:
C:\CodeRepo\xyz-sample>mvn clean install -e -X
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T00:30:29+05:30)
Maven home: C:\Program Files\apache-maven-3.6.1\bin\..
Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_202\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.annotation.* < plexus.core
[DEBUG] Imported: javax.annotation.security.* < plexus.core
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
[DEBUG] Imported: javax.inject.* < plexus.core
[DEBUG] Imported: org.apache.maven.* < plexus.core
[DEBUG] Imported: org.apache.maven.artifact < plexus.core
[DEBUG] Imported: org.apache.maven.classrealm < plexus.core
[DEBUG] Imported: org.apache.maven.cli < plexus.core
[DEBUG] Imported: org.apache.maven.configuration < plexus.core
[DEBUG] Imported: org.apache.maven.exception < plexus.core
[DEBUG] Imported: org.apache.maven.execution < plexus.core
[DEBUG] Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG] Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG] Imported: org.apache.maven.model < plexus.core
[DEBUG] Imported: org.apache.maven.monitor < plexus.core
[DEBUG] Imported: org.apache.maven.plugin < plexus.core
[DEBUG] Imported: org.apache.maven.profiles < plexus.core
[DEBUG] Imported: org.apache.maven.project < plexus.core
[DEBUG] Imported: org.apache.maven.reporting < plexus.core
[DEBUG] Imported: org.apache.maven.repository < plexus.core
[DEBUG] Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG] Imported: org.apache.maven.settings < plexus.core
[DEBUG] Imported: org.apache.maven.toolchain < plexus.core
[DEBUG] Imported: org.apache.maven.usability < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG] Imported: org.codehaus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.* < plexus.core
[DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.component < plexus.core
[DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG] Imported: org.codehaus.plexus.container < plexus.core
[DEBUG] Imported: org.codehaus.plexus.context < plexus.core
[DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG] Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG] Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG] Imported: org.eclipse.aether.* < plexus.core
[DEBUG] Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG] Imported: org.eclipse.aether.collection < plexus.core
[DEBUG] Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG] Imported: org.eclipse.aether.graph < plexus.core
[DEBUG] Imported: org.eclipse.aether.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.installation < plexus.core
[DEBUG] Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG] Imported: org.eclipse.aether.repository < plexus.core
[DEBUG] Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG] Imported: org.eclipse.aether.spi < plexus.core
[DEBUG] Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG] Imported: org.eclipse.aether.version < plexus.core
[DEBUG] Imported: org.fusesource.jansi.* < plexus.core
[DEBUG] Imported: org.slf4j.* < plexus.core
[DEBUG] Imported: org.slf4j.event.* < plexus.core
[DEBUG] Imported: org.slf4j.helpers.* < plexus.core
[DEBUG] Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Message scheme: color
[DEBUG] Message styles: debug info warning error success failure strong mojo project
[DEBUG] Reading global settings from C:\Program Files\apache-maven-3.6.1\bin\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\ach\.m2\settings.xml
[DEBUG] Reading global toolchains from C:\Program Files\apache-maven-3.6.1\bin\..\conf\toolchains.xml
[DEBUG] Reading user toolchains from C:\Users\ach\.m2\toolchains.xml
[DEBUG] Using local repository at C:\Users\ach\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\Users\ach\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Could not find metadata com.xyz.sample:xyz-par-pom:1.1.10-SNAPSHOT/maven-metadata.xml in local (C:\Users\ach\.m2\repository)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xyz.sample:ds-sample:1.1.10-SNAPSHOT: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.xyz.sample:ds-sample:1.1.10-SNAPSHOT: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:395)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] The project com.xyz.sample:ds-sample:1.1.10-SNAPSHOT (C:\CodeRepo\xyz-sample\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.xyz.sample:ds-sample:1.1.10-SNAPSHOT: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:196)
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:242)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1062)
at org.apache.maven.model.building.DefaultModelBuilder.readParent (DefaultModelBuilder.java:838)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:332)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:446)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:412)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:375)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:423)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:225)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:202)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:257)
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:192)
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:242)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1062)
at org.apache.maven.model.building.DefaultModelBuilder.readParent (DefaultModelBuilder.java:838)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:332)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:446)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:412)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:375)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.xyz.sample:xyz-par-pom:pom:1.1.10-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:413)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:225)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:202)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:257)
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:192)
at org.apache.maven.project.ProjectModelResolver.resolveModel (ProjectModelResolver.java:242)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1062)
at org.apache.maven.model.building.DefaultModelBuilder.readParent (DefaultModelBuilder.java:838)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:332)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:446)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:412)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:375)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
我有一个类似的问题,我通过在pom中启用快照来解决它。xml配置(尽管默认值应为true):
<!-- Artifacts download location -->
<repositories>
<repository>
<id>remote-repo</id> <!-- as in settings.xml -->
<url>http://myurl-for-group-content</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
如果没有上述配置,它也可以为父pom使用正式版本(而不是SNAPSHOT)。
我已经成功地与另一位现场开发人员一起使用GitLab,开发了C和MATLAB中的小型项目。 在家使用VPN工作时,我将一个大型LabVIEW程序推到了一个新项目中,这样我就可以与另一个非现场开发人员一起工作。开发人员克隆了该项目,并开始开发一个分支。 问题是我无法提取/获取此分支。GitLab正在显示开发人员所做的分支和提交。 我使用git的时间不长,所以我可能只是太傻了。 Git推送:“致命的‘
我只是做了将我的文件夹初始化为git存储库,然后使用添加了一个远程存储库。现在我想删除这个并添加一个新的存储库。我怎么做?
与这个问题类似,我正在尝试断开我的hg存储库与一个死的远程位置的连接,同时保持本地版本控制。 的汞当量是什么?
我正试着和git建立联系http://danielmiessler.com/study/git/#website来管理我的网站。 我已经完成了说明中的最后一步:git推送网站master:refs/heads/master 我正在使用win7中的git ming32命令行 这里的一个问题可能是程序正在寻找Bill@***. com。当我通过ssh连接到我的网站时,我有一个不同的用户名(让我们说“a
我正在通过一个对我来说是新的IDE进行一个学校项目:IntelliJ。 为了提交我的项目(通过git),我创建了一个git存储库,添加了正确的remote及其密码,并尝试将我的工作推到主分支(在成功添加/提交所述工作之后)。 一开始我收到以下错误消息: 推送失败:失败,错误:致命:无法从远程存储库读取。 下面是我的文件: 我哪里错了?
因此,在本教程之后,我使用Dropbox创建了自己的远程存储库。此外,我使用以下命令将第三方JAR部署到我的存储库中。 mvn部署:部署-文件-Dgroup pId=com.prowritingaid.java-DartifactId=pro_writing_aid_java-Dversion=2.0.0-D包装=jar-Dfile=pro_writing_aid_java-2.0.0.jar-D