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

self-dependency used by maven-invoker-plugin leads to runtime error #9783

Open
yegor256 opened this issue Jan 20, 2025 · 0 comments
Open

self-dependency used by maven-invoker-plugin leads to runtime error #9783

yegor256 opened this issue Jan 20, 2025 · 0 comments
Labels
bug Issues that are considered to be bugs to triage Issues that need triaging

Comments

@yegor256
Copy link

yegor256 commented Jan 20, 2025

In our project, we use maven-invoker-plugin, which make us have a pom.xml file in the repo, with the following dependency inside:

    <dependency>
      <groupId>org.eolang</groupId>
      <artifactId>lints</artifactId>
      <version>@project.version@</version>
    </dependency>

Here, the @project.version@ is a placeholder, which is replaced with 1.0-SNAPSHOT in runtime (this is how maven-invoker-plugin works). However, ORT fails with an error:

org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: The following artifacts could not be resolved: org.eolang:lints:pom:@project.version@ (absent): Could not find artifact org.eolang:lints:pom:@project.version@ in central (https://repo.maven.apache.org/maven2) for project org.eolang:lints:pom:@project.version@
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:322)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:295)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenSupport.parsePackage$lambda$48$lambda$44(MavenSupport.kt:469)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenSupport.wrapMavenSession(MavenSupport.kt:584)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenSupport.parsePackage(MavenSupport.kt:468)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenSupport.parsePackage$default(MavenSupport.kt:441)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenDependencyHandler.createPackage(MavenDependencyHandler.kt:98)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.utils.MavenDependencyHandler.createPackage(MavenDependencyHandler.kt:40)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.updateResolvedPackages$lambda$27(DependencyGraphBuilder.kt:419)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.updateResolvedPackages$lambda$28(DependencyGraphBuilder.kt:419)
	at java.base/java.util.HashMap.compute(HashMap.java:1324)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.updateResolvedPackages(DependencyGraphBuilder.kt:419)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.updateDependencyMappingAndPackages(DependencyGraphBuilder.kt:290)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.addDependencyToGraph(DependencyGraphBuilder.kt:257)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.addDependency(DependencyGraphBuilder.kt:149)
	at org.ossreviewtoolkit.plugins.packagemanagers.maven.Maven.resolveDependencies(Maven.kt:129)
	at org.ossreviewtoolkit.analyzer.PackageManager.resolveDependencies(PackageManager.kt:295)
	at org.ossreviewtoolkit.analyzer.PackageManagerRunner$run$3.invokeSuspend(Analyzer.kt:321)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.eolang:lints:pom:@project.version@ (absent): Could not find artifact org.eolang:lints:pom:@project.version@ in central (https://repo.maven.apache.org/maven2)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:473)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:243)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:278)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:313)
	... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.eolang:lints:pom:@project.version@ in central (https://repo.maven.apache.org/maven2)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:42)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:260)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:537)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449)
	... 29 more

This is a full log.

Surprisingly, there are no issues in another project, the build passes: log

@yegor256 yegor256 added bug Issues that are considered to be bugs to triage Issues that need triaging labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that are considered to be bugs to triage Issues that need triaging
Projects
None yet
Development

No branches or pull requests

1 participant