Maven - Non-resolvable parent POM, Could not find artifact SNAPSHOT

Viewed 2515

I am trying to build a maven project. I don't have experience in building Java projects, and this is my first maven project. 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:

[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:

<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?

1 Answers

The error says that the parent POM my.project.tk.at:parentpom:pom:5.20.0-SNAPSHOT cannot be found.

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).

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. Also read the helpful comments of Stanislav Bashkyrtsev.

Related