[英]Maven - Non-resolvable parent POM, Could not find artifact SNAPSHOT
I am trying to build a maven project.我正在尝试构建一个 Maven 项目。 I don't have experience in building Java projects, and this is my first maven project.
我没有构建Java项目的经验,这是我的第一个maven项目。 I have tried to build the project from both the terminal and the IntelliJ, and I am receiving this error when I run
mvn clean install
:我尝试从终端和 IntelliJ 构建项目,当我运行
mvn clean install
时收到此错误:
[FATAL] Non-resolvable parent POM for my.project.tk.at.batcher:batcher:${revision}:
Could not find artifact my.project.tk.at:parentpom:pom:5.20.0-SNAPSHOT and
'parent.relativePath' points at wrong local POM
This is the pom.xml
file:这是
pom.xml
文件:
<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>
<parent>
<groupId>my.project.tk.at</groupId>
<artifactId>parentpom</artifactId>
<version>5.20.0-SNAPSHOT</version>
</parent>
<groupId>my.project.tk.at.batcher</groupId>
<artifactId>batcher</artifactId>
<name>batcher</name>
<packaging>pom</packaging>
<version>${revision}</version>
<scm>
<connection>scm:git:ssh://git@git.my.project.no/autfor/jobscheduler.git</connection>
<developerConnection>scm:git:ssh://git@git.my.project.no/autfor/jobscheduler.git</developerConnection>
<url>https://git.my.project.no/projects/AUTFOR/repos/jobscheduler</url>
</scm>
<properties>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<version.patch>0</version.patch>
<revision>${version.major}.${version.minor}.${version.patch}-SNAPSHOT</revision>
</properties>
<!-- Shared build properties -->
<modules>
<module>batcher-common</module>
<module>batcher-sql</module>
<module>scheduler</module>
<module>notifier-batch</module>
<module>notifier-examtime-batch</module>
<module>notifier-attest-batch</module>
<module>ssb-batch</module>
<module>alert-user-batch</module>
<module>delete-history-batch</module>
<module>alert-user-about-delivery-batch</module>
<module>batcher-main</module>
<module>delete-quarantine-batch</module>
</modules>
<distributionManagement>
<repository>
<id>svv-artrepo-release</id>
<name>svv-artrepo-release</name>
<url>https://artrepo.remote-project.no/artifactory/libs-release-local</url>
</repository>
<snapshotRepository>
<id>svv-artrepo-snapshots</id>
<name>svv-artrepo-snapshots</name>
<url>https://artrepo.remote-project.no/artifactory/libs-snapshot-local</url>
</snapshotRepository>
<!-- <repository>-->
<!-- <id>nexus-release-repository</id>-->
<!-- <name>Nexus release repo</name>-->
<!-- <url>http://10.250.4.100:8081/nexus/content/repositories/releases</url>-->
<!-- </repository>-->
<!-- <snapshotRepository>-->
<!-- <id>nexus-snapshot-repository</id>-->
<!-- <url>http://10.250.4.100:8081/nexus/content/repositories/snapshots</url>-->
<!-- <layout>default</layout>-->
<!-- </snapshotRepository>-->
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- copy from common master, since ${project.build.directory} gets false value if it is not duplicated -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<propertyName>failsafeArgLine</propertyName>
<destFile>${project.build.directory}/jacoco.exec</destFile>
<append>true</append>
</configuration>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Exclude all generated sources -->
<excludes>
<exclude>**/wsgen/**/*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>codecoverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-test</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>owasp</id>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven-project-info-reports-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${org.owasp.dependency-check-maven.version}</version>
<reportSets>
<reportSet>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
</project>
How can I fix this error?我该如何解决这个错误?
The error says that the parent POM my.project.tk.at:parentpom:pom:5.20.0-SNAPSHOT
cannot be found.该错误表示无法找到父 POM
my.project.tk.at:parentpom:pom:5.20.0-SNAPSHOT
。
So it is not in your local repository (you haven't built it locally and you haven't used it before) and it is also not in any of the remote repositories you specified (if you specified any in your settings.xml
or pom.xml
).所以它不在你的本地存储库中(你没有在本地构建它,你以前也没有使用过它),它也不在你指定的任何远程存储库中(如果你在
settings.xml
或pom.xml
指定了任何pom.xml
)。
So either correct the parent POM to the one you are really looking for or see why the desired parent POM is not in the specified repositories.因此,要么将父 POM 更正为您真正要查找的 POM,要么查看为什么所需的父 POM 不在指定的存储库中。 Also read the helpful comments of Stanislav Bashkyrtsev.
另请阅读 Stanislav Bashkyrtsev 的有用评论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.