Uploaded image for project: 'Maven Help Plugin'
  1. Maven Help Plugin
  2. MPH-171

Plugin repositories are not preserved from project pom

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • effective-pom
    • None

    Description

      Description 

      When computing the effective POM for an external artifact the plugin-repositories of the local project are not taken into account.

      Reproduction case

      <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>
      
        <groupId>org.example</groupId>
        <artifactId>maven-help-plugin-missing-pluginrepositories</artifactId>
        <version>1.0.0-SNAPSHOT</version>
      
        <build>
          <pluginManagement>
            <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-help-plugin</artifactId>
                <version>3.2.0</version>
              </plugin>
            </plugins>
          </pluginManagement>
        </build>
      
        <pluginRepositories>
          <pluginRepository>
            <id>atlassian-public</id>
            <url>https://packages.atlassian.com/maven-external</url>
            <releases>
              <enabled>true</enabled>
            </releases>
          </pluginRepository>
        </pluginRepositories>
        <repositories>
          <repository>
            <id>atlassian-public</id>
            <url>https://packages.atlassian.com/maven-external</url>
            <releases>
              <enabled>true</enabled>
            </releases>
          </repository>
        </repositories>
      </project>
      
      $ mvn help:effective-pom -Dartifact=com.atlassian.confluence:confluence-webapp:6.13.10
      

      Expected result

      The correct effective POM is shown.

      Actual result

      The following error occurs

      [INFO] 
      [INFO] ------< org.example:maven-help-plugin-missing-pluginrepositories >------
      [INFO] Building maven-help-plugin-missing-pluginrepositories 1.0.0-SNAPSHOT
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO] 
      [INFO] --- maven-help-plugin:3.2.0:effective-pom (default-cli) @ maven-help-plugin-missing-pluginrepositories ---
      [WARNING] The POM for com.atlassian.maven.plugins:artifactory-staging-maven-plugin:jar:2.0.1 is missing, no dependency information available
      [WARNING] Failed to build parent project for com.atlassian.confluence:confluence-project:pom:6.13.10
      [WARNING] Failed to build parent project for com.atlassian.confluence:confluence-webapp:war:6.13.10
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  1.191 s
      [INFO] Finished at: 2021-01-06T14:24:24+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.2.0:effective-pom (default-cli) on project maven-help-plugin-missing-pluginrepositories: Unable to get the POM for the artifact 'com.atlassian.confluence:confluence-webapp:6.13.10'. Verify the artifact parameter.: Some problems were encountered while processing the POMs:
      [ERROR] [ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.1 or one of its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugin:jar:2.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @: 1 problem was encountered while building the effective model for com.atlassian.confluence:confluence-webapp:6.13.10
      [ERROR] [ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.1 or one of its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugin:jar:2.0.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      

      Root cause

      AbstractHelpMojo.getMavenProject does not add the current pluginartifact-repositories to the ProjectBuildingRequest. It does so for the normal remote-repositories

      Attachments

        Issue Links

          Activity

            People

              slachiewicz Sylwester Lachiewicz
              t-8ch Thomas Weißschuh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: