Spoiler Alert: Upcoming Maven 3.4.0 - Changes - II

Currently the preparations for the upcoming Maven 3.4.0 release is running. There had been informations about the changes for the next Maven release.

I will give some more information about changes which are (might be!) part of the next Maven release.

Just be warned that you do not blame me if a particular issue will not part of the final release. This is written from the current perspecitve. So no warranty about that.

If you like to create source packages during the release you can use the defined state in the super pom, but unfortunately there is little issue with the default definitions which causes the generate-resources and the generate-sources life cycle phase to run twice based on the bound goal of the maven-source-plugin which forkes the life cycle. So a typical workaorund is to detach the maven-source-plugin form the life cycle via the following:

 1  <pluginManagment>
 2    <plugins>
 3      ..
 4      <plugin>
 5        <groupId>org.apache.maven.plugins</groupId>
 6        <artifactId>maven-source-plugin</artifactId>
 7        <version>..</version>
 8        <executions>
 9          <execution>
10            <id>attach-sources</id>
11            <phase>DISABLE_FORKED_LIFECYCLE_MSOURCES</phase>
12          </execution>
13        </executions>
14      </plugin>
15      ..
16    </plugins> 
17  </pluginManagment>
18..

But to keep generating a source package during the release you need to add the following to your pom file:

 1  <plugins>
 2    <plugin>
 3      <inherited>true</inherited>
 4      <artifactId>maven-source-plugin</artifactId>
 5      <executions>
 6        <execution>
 7          <id>attach-sources-no-fork</id>
 8          <inherited>true</inherited>
 9          <goals>
10            <goal>jar-no-fork</goal>
11          </goals>
12        </execution>
13      </executions>
14    </plugin>
15  </plugins>

The above workaround is no longer needed cause the super pom has been changed accordingly to MNG-5940 and exactly contains the binding with the jar-no-fork goal.