Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pomchecker CLI does not resolve artifacts from Maven Central #22

Closed
gastaldi opened this issue Aug 29, 2024 · 2 comments · Fixed by #23
Closed

Pomchecker CLI does not resolve artifacts from Maven Central #22

gastaldi opened this issue Aug 29, 2024 · 2 comments · Fixed by #23
Labels
released Issue has been released

Comments

@gastaldi
Copy link
Contributor

Having a pom.xml like the following:

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.quarkiverse</groupId>
        <artifactId>quarkiverse-parent</artifactId>
        <version>17</version>
    </parent>
    <groupId>io.quarkiverse.slack</groupId>
    <artifactId>quarkus-slack-parent</artifactId>
    <version>0.0.2</version>
    <packaging>pom</packaging>
</project>

First run rm -rf ~/.m2/repository/io/quarkiverse to make sure your local repository does not have the parent artifact.

When I run pomchecker check-maven-central --file pom.xml the following error is shown:

[INFO] Maven Central checks: /private/tmp/jreleaser/repository/pom.xml
org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while building the effective model for io.quarkiverse.slack:quarkus-slack-parent:0.0.2
[FATAL] Non-resolvable parent POM for io.quarkiverse.slack:quarkus-slack-parent:0.0.2: The following artifacts could not be resolved: io.quarkiverse:quarkiverse-parent:pom:17 (absent): Could not find artifact io.quarkiverse:quarkiverse-parent:pom:17 and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 for project io.quarkiverse.slack:quarkus-slack-parent:0.0.2 at /private/tmp/jreleaser/repository/pom.xml
java.lang.IllegalStateException: org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while building the effective model for io.quarkiverse.slack:quarkus-slack-parent:0.0.2
[FATAL] Non-resolvable parent POM for io.quarkiverse.slack:quarkus-slack-parent:0.0.2: The following artifacts could not be resolved: io.quarkiverse:quarkiverse-parent:pom:17 (absent): Could not find artifact io.quarkiverse:quarkiverse-parent:pom:17 and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 for project io.quarkiverse.slack:quarkus-slack-parent:0.0.2 at /private/tmp/jreleaser/repository/pom.xml
	at org.kordamp.maven.checker.cli.internal.PomParser.createMavenProject(PomParser.java:102)
	at org.kordamp.maven.checker.cli.internal.PomParser.createMavenProject(PomParser.java:66)
	at org.kordamp.maven.checker.cli.CheckMavenCentral.execute(CheckMavenCentral.java:61)
	at org.kordamp.maven.checker.cli.AbstractCommand.call(AbstractCommand.java:102)
	at org.kordamp.maven.checker.cli.CheckMavenCentral.call(CheckMavenCentral.java:30)
	at org.kordamp.maven.checker.cli.AbstractCommand.call(AbstractCommand.java:34)
	at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
	at picocli.CommandLine.access$1500(CommandLine.java:148)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
	at picocli.CommandLine.execute(CommandLine.java:2170)
	at org.kordamp.maven.checker.cli.Main.execute(Main.java:86)
	at org.kordamp.maven.checker.cli.Main.run(Main.java:72)
	at org.kordamp.maven.checker.cli.Main.main(Main.java:64)
Caused by: org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while building the effective model for io.quarkiverse.slack:quarkus-slack-parent:0.0.2
[FATAL] Non-resolvable parent POM for io.quarkiverse.slack:quarkus-slack-parent:0.0.2: The following artifacts could not be resolved: io.quarkiverse:quarkiverse-parent:pom:17 (absent): Could not find artifact io.quarkiverse:quarkiverse-parent:pom:17 and 'parent.relativePath' points at wrong local POM @ line 5, column 13
 for project io.quarkiverse.slack:quarkus-slack-parent:0.0.2 at /private/tmp/jreleaser/repository/pom.xml
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:180)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:123)
	at org.kordamp.maven.checker.cli.internal.PomParser.createMavenProject(PomParser.java:99)
	... 16 more
Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for io.quarkiverse.slack:quarkus-slack-parent:0.0.2
[FATAL] Non-resolvable parent POM for io.quarkiverse.slack:quarkus-slack-parent:0.0.2: The following artifacts could not be resolved: io.quarkiverse:quarkiverse-parent:pom:17 (absent): Could not find artifact io.quarkiverse:quarkiverse-parent:pom:17 and 'parent.relativePath' points at wrong local POM @ line 5, column 13

	at org.apache.maven.model.building.DefaultModelProblemCollector.newModelBuildingException(DefaultModelProblemCollector.java:176)
	at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1033)
	at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:801)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:327)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:243)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:176)
	... 18 more
@gastaldi
Copy link
Contributor Author

Apparently a call is missing to projectBuildingRequest.setRemoteRepositories(...) here:

projectBuildingRequest.setRepositorySession(context.repositorySystemSession());

@gastaldi gastaldi changed the title Pomchecker does not resolve artifacts from Maven Central Pomchecker CLI does not resolve artifacts from Maven Central Aug 29, 2024
@aalmiray
Copy link
Contributor

🎉 This issue has been resolved in v1.12.0 (Release Notes)

@aalmiray aalmiray added the released Issue has been released label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants