I have a simple multi-module project.

I am trying to release it with the maven-release-plugin.

I've done this hundreds of times before with non-multi-module projects.

One of the requirements of Maven Central is that your binary artifacts must
be accompanied by source and javadoc artifacts. Everything additionally has
to be signed. I'm familiar with all of this.

Given the new build-failing behavior of the maven-source-plugin 3.3.0,
which fails the build when it is invoked twice, what is the new recipe for
ensuring that, during release, both javadoc jars and source jars are
attached at the relevant points in the multi-module build?

I ask because this profile, activated via the releaseProfiles user property:

<profiles>
    <profile>
      <id>deployment</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>jar-no-fork</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

...no longer works.  That is, when I tell the maven-release-plugin to
activate the "deployment" profile (via the releaseProfiles user property),
I am told that the source plugin has been invoked twice, and the build
fails.

I'm sure there must exist a very simple example of a "good" multi-module
pom suitable for publishing to Maven Central with all the requirements
fulfilled and using modern versions of the plugins required. I just don't
know where to find it.

Best,
Laird

Reply via email to