3

カスタム Maven プラグインを完全に新しいシステムで使用しようとしています。カスタム Maven プラグインで使用される親 POM を解決していないようです。

私はいくつかのことを試しましたが、途方に暮れています。

どんな洞察も大歓迎です。ありがとうございました。

アップデート

これは非常に奇妙です....このエラーは、ローカルリポジトリをクリーンアップする場合にのみ発生します (新しい開発者や統合システムなどのクリーンなシステムをシミュレートします)。「mvn -U install」コマンドをすぐに (コマンドをまったく変更せずに) 再度実行すると、正常にビルドされます!

これは「推移的な依存関係」を叫びますが、どうすればそのような違反を見つけることができますか?

アップデート

これはMavenのバグだと思います。同じプロジェクトにあるにもかかわらず、リアクターは親 POM を見つけられません! 皆さんはどう思いますか?

カスタム プラグイン POM:

<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.org</groupId>
        <artifactId>parent-java-with-foundation</artifactId>
        <version>11.1.1.8-SNAPSHOT</version>
        <relativePath></relativePath>
    </parent>

    <groupId>my.org.maven</groupId>
    <artifactId>maven-plugin</artifactId>
    <version>11.1.1.8-SNAPSHOT</version>
    <packaging>maven-plugin</packaging>

</project>

エラー トレース:

[ERROR] Plugin my.org.maven:maven-plugin:11.1.1.8-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for my.org.maven:maven-plugin:jar:11.1.1.8-SNAPSHOT: Could not find artifact my.org:parent-java-with-foundation:pom:11.1.1.8-SNAPSHOT -> [Help 1] org.apache.maven.plugin.PluginResolutionException: Plugin my.org.maven:maven-plugin:11.1.1.8-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for my.org.maven:maven-plugin:jar:11.1.1.8-SNAPSHOT
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:122)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:146)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:265)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:190)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:157)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:144)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:121)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:134)
    at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for my.org.maven:maven-plugin:jar:11.1.1.8-SNAPSHOT
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:370)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:288)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:108)
    ... 25 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact my.org:parent-java-with-foundation:pom:11.1.1.8-SNAPSHOT
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:817)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:669)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:307)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:361)
    ... 28 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact my.org:parent-java-with-foundation:pom:11.1.1.8-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:122)
    ... 32 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact my.org:parent-java-with-foundation:pom:11.1.1.8-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449)
    ... 35 more
4

1 に答える 1