3

I am trying to use mvn help:effective-pom -Dartifact=com.group:artifactname:1.0.0-SNAPSHOT but it is still printing out effective pom for a current project.

Is there any way to use it? I am following Maven help:effective-pom documentation.

davidxxx
  • 125,838
  • 23
  • 214
  • 215
Dawid Pura
  • 991
  • 9
  • 32
  • 1
    have you tried `-f,--file Force the use of an alternate POM file (or directory with pom.xml).` – Jens Aug 23 '18 at 09:14
  • Try adding `-X` to your execution to get verbose output. Might be worth redirecting the output to a file, because I would expect it to be lenghty, and any relevant information (such as the artifact not being found) to be found in the first few lines. – Aaron Aug 23 '18 at 09:20

1 Answers1

4

This parameter is recent : it requires at least the 3.0.0 version of maven-help-plugin.
Your pom.xml doesn't use it very probably.
Note that you don't have any error in the output because a user property (-D) may be used to define a plugin parameter or any custom property. So the plugin just doesn't use it if it is not recognized.

So configure your pom to use a maven-help-plugin version that supports it or the last :

<build>
    <plugins>
      <plugin>
         <artifactId>maven-help-plugin</artifactId>
         <version>3.1.0</version>
      </plugin>
    </plugins>
<build>

or specify explicitly the version of the plugin in the command line :

mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:effective-pom -Dartifact=com.group:artifactname:1.0.0-SNAPSHOT
davidxxx
  • 125,838
  • 23
  • 214
  • 215
  • 1
    I have tried that as well (that was the first thing that came to my mind) without any success - it's still printing out the effective pom of the project instead of specific artifact, unfortunately. – Dawid Pura Aug 23 '18 at 09:35
  • @Dawid Pura It works very well. I just tested the command. Could you test with a specific library ? For example : `com.google.guava:guava:24.0-jre` such as `mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:effective-pom -Dartifact=com.google.guava:guava:24.0-jre` – davidxxx Aug 23 '18 at 09:37
  • You probably test with an artifact that depends on the current project. – davidxxx Aug 23 '18 at 09:42