Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7618

Use goalPrefix instead of artifactId to display mojos being executed

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.9.0, 4.0.0-alpha-3, 4.0.0
    • None
    • None

    Description

      The main problem is that the information displayed when starting a mojo looks like:

      [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-version) @ camel ---
      [INFO] 
      [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-java-version) @ camel ---
      [INFO] 
       

      However, if you try to execute maven-enforcer-plugin:3.0.0:enforce, you end up with the following:

      [INFO] BuildTimeEventSpy is registered.
      [INFO] Scanning for projects...
      Downloading from apache.snapshots: https://repository.apache.org/snapshots/maven-enforcer-plugin/3.0.0/maven-metadata.xml
      Downloading from central: https://repo.maven.apache.org/maven2/maven-enforcer-plugin/3.0.0/maven-metadata.xml
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  0.879 s
      [INFO] Finished at: 2022-12-03T12:12:40+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Error resolving version for plugin 'maven-enforcer-plugin:3.0.0' from the repositories [local (/Users/gnodet/.m2/repository), apache.snapshots (https://repository.apache.org/snapshots/), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException
       

       
      I suggest to change the display to the pluginPrefix which gives

      [INFO] -----------------------< org.apache.camel:camel >-----------------------
      [INFO] Building Camel 4.0.0-SNAPSHOT
      [INFO]   from pom.xml
      [INFO] --------------------------------[ pom ]---------------------------------
      [WARN] Parameter 'reportPlugins' is unknown for plugin 'maven-site-plugin:3.11.0:attach-descriptor (attach-descriptor)'
      [INFO] 
      [INFO] --- enforcer:3.0.0:enforce (enforce-maven-version) @ camel ---
      [INFO] 
      [INFO] --- enforcer:3.0.0:enforce (enforce-java-version) @ camel ---
      [INFO] 
      [INFO] --- enforcer:3.0.0:enforce (enforce-maven) @ camel ---
      [INFO] 
      

      which can then be easily executed:

      ➜  maven git:(build-improvements) ✗ mvn -N -f ../camel flatten:1.2.5:flatten 
      [INFO] BuildTimeEventSpy is registered.
      [INFO] Processing build on daemon 56c20cb8
      [INFO] Scanning for projects...
      [INFO] BuildTimeEventSpy is registered.
      [INFO] 
      [INFO] Using the SmartBuilder implementation with a thread count of 9
      [INFO] Task segments : [flatten:1.2.5:flatten]
      [INFO] Build maximum degree of concurrency is 9
      [INFO] Total number of projects is 1
      [INFO] 
      [INFO] -----------------------< org.apache.camel:camel >-----------------------
      [INFO] Building Camel 4.0.0-SNAPSHOT
      [INFO]   from pom.xml
      [INFO] --------------------------------[ pom ]---------------------------------
      [INFO] 
      [INFO] --- flatten:1.2.5:flatten (default-cli) @ camel ---
      [INFO] Generating flattened POM of project org.apache.camel:camel:pom:4.0.0-SNAPSHOT...
      [INFO] Segment walltime 0 s, segment projects service time 0 s, effective/maximum degree of concurrency 0.97/9
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  0.025 s (Wall Clock)
      [INFO] Finished at: 2022-12-03T12:14:29+01:00
      [INFO] ------------------------------------------------------------------------
      ➜  maven git:(build-improvements) ✗ 
      

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              gnodet Guillaume Nodet
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: