Skip to content

Commit

Permalink
Wrap gradle catalog+platform logic in a profile
Browse files Browse the repository at this point in the history
We don't want it being triggered in downstream projects that
extend pom-scijava -- only in the pom-scijava build itself.
  • Loading branch information
ctrueden committed Jun 10, 2024
1 parent 431ebf9 commit 9cd9000
Showing 1 changed file with 64 additions and 53 deletions.
117 changes: 64 additions & 53 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6820,57 +6820,68 @@
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-gradle-catalog-and-platform</id>
<phase>generate-sources</phase>
<goals>
<!-- https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html -->
<goal>exec</goal>
</goals>
<configuration>
<executable>./gradlew</executable>
<workingDirectory>${basedir}/gradle-scijava</workingDirectory>
<arguments>
<argument>--project-cache-dir</argument>
<argument>../target/gradle/build</argument>
<argument>generateCatalogAndPlatform</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-gradle-catalog-and-platform</id>
<goals>
<!-- https://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html -->
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/gradle/version-catalog/libs.versions.toml</file>
<type>toml</type>
</artifact>
<artifact>
<file>target/gradle/publications/pomScijava/module.json</file>
<!-- it should be published with the `.module` extension -->
<type>module</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>scijava-gradle-catalog-and-platform</id>
<activation>
<file>
<exists>${basedir}/gradle-scijava</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-gradle-catalog-and-platform</id>
<phase>generate-sources</phase>
<goals>
<!-- https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html -->
<goal>exec</goal>
</goals>
<configuration>
<executable>./gradlew</executable>
<workingDirectory>${basedir}/gradle-scijava</workingDirectory>
<arguments>
<argument>--project-cache-dir</argument>
<argument>../target/gradle/build</argument>
<argument>generateCatalogAndPlatform</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-gradle-catalog-and-platform</id>
<goals>
<!-- https://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html -->
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/gradle/version-catalog/libs.versions.toml</file>
<type>toml</type>
</artifact>
<artifact>
<file>target/gradle/publications/pomScijava/module.json</file>
<!-- it should be published with the `.module` extension -->
<type>module</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 9cd9000

Please sign in to comment.