Description
While debugging the problem described here, I've noticed something strange.
I have a project which has the following config for the "maven-source-plugin"
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
</plugin>
and the this in the parent-pom
<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
As the sources-jar is uploaded twice the build fails, thus I checked the "effective pom" by running
mvn -Prelease-profile help:effective-pom
The result is strange as the configuration for the maven-source-plugin is something totally different. Once under "pluginManagement"
<build> ... <pluginManagement> ... <plugin> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> ... </pluginManagement>
and once under "plugins"
<build>
...
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
<configuration>
<attach>true</attach>
</configuration>
</execution>
</executions>
I don't understand how this is possible and where the config comes from. Is this a bug? Something I miss?