ARTEMIS-4048: stop -all client modules needlessly grabbing their own -SNAPSHOT sources during build

- Always produce the original basically-empty sources jar for the
  module, before the shading, meaning its always available.
- Do the same for the main jar, to avoid the shading operating on a
  previously-shaded renamed output from a prior run if not cleaning.
This commit is contained in:
Robbie Gemmell 2022-10-13 13:06:09 +01:00
parent 7b2f7e1707
commit 8cba446e2b
3 changed files with 117 additions and 0 deletions

View File

@ -40,7 +40,46 @@
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- Override root pom definition, so as to ensure the shading has a fresh base sources jar
for the module before shading, with nothing much in it, and doesnt instead grab a large
already-shaded remote snapshot, possibly each day (local) or on every build (CI) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<!-- Ensures the shading is always working upon a fresh base jar, which has
nothing much in it, rather than potentially working on already-shaded
output still present from prior runs and renamed to have the base name -->
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@ -41,7 +41,46 @@
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- Override root pom definition, so as to ensure the shading has a fresh base sources jar
for the module before shading, with nothing much in it, and doesnt instead grab a large
already-shaded remote snapshot, possibly each day (local) or on every build (CI) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<!-- Ensures the shading is always working upon a fresh base jar, which has
nothing much in it, rather than potentially working on already-shaded
output still present from prior runs and renamed to have the base name -->
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

View File

@ -40,7 +40,46 @@
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- Override root pom definition, so as to ensure the shading has a fresh base sources jar
for the module before shading, with nothing much in it, and doesnt instead grab a large
already-shaded remote snapshot, possibly each day (local) or on every build (CI) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<!-- Ensures the shading is always working upon a fresh base jar, which has
nothing much in it, rather than potentially working on already-shaded
output still present from prior runs and renamed to have the base name -->
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>