I found that even without specifying maven-jar-plugin in the POM, when I run mvn package, it will still generate the JAR.
So what is the point to include it as a plugin explicitly in the POM file ?
...the version, or custom configuration/execution, the "default configuration" in Maven:3.8.4 is:
...
<build>
<plugins>
<plugin>
<!-- in maven#plugins we "never" need to write <groupId>org.apache.maven.plugins</groupId> , since this is also "default plugin group id" -->
<artifactId>maven-jar-plugin</artifactId> <!-- org.apache.maven:maven-core:3.8.4:default-lifecycle-bindings -->
<version>2.4</version> <!-- org.apache.maven:maven-core:3.8.4:default-lifecycle-bindings -->
<executions>
<execution>
<id>default-jar</id> <!-- org.apache.maven:maven-core:3.8.4:default-lifecycle-bindings -->
<phase>package</phase> <!-- org.apache.maven:maven-core:3.8.4:default-lifecycle-bindings -->
<goals>
<goal>jar</goal> <!-- org.apache.maven:maven-core:3.8.4:default-lifecycle-bindings -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
You can "always" find your "implicit" configuration(s) by issuing:
mvn -Doutput=eff.pom.xml -Dverbose=true help:effective-pom -P myProfile,...
...and inspection of eff.pom.xml. Ref (or use netbeans' "effective pom" view/tab;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With