Skip to content

Commit

Permalink
Target just the library module for deploying the jar to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
jared-daniels committed Nov 20, 2024
1 parent 0f2d202 commit 7deaa02
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 88 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/beta-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
mvn versions:set -DnewVersion=${{ steps.new_version.outputs.new_version }} -DgenerateBackupPoms=false
- name: Generate Javadocs
run: mvn javadoc:javadoc
run: mvn -pl library javadoc:javadoc

- name: Create Tag
run: |
Expand All @@ -117,6 +117,5 @@ jobs:
- name: Publish to Maven Central Beta
run: |
mvn -pl library javadoc:jar
mvn --batch-mode clean install -DskipTests
mvn --batch-mode deploy -P deploy-to-maven-central-beta -DskipTests
mvn -pl library deploy -P deploy-to-maven-central-beta -DskipTests --batch-mode
85 changes: 83 additions & 2 deletions library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,94 @@
</plugins>
</build>
</profile>

<!-- Profile for deploying to maven central-->
<profile>
<id>deploy-to-maven-central-beta</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>

<build>
<!-- These plugins run when using this profile.-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>21</source>
<show>private</show>
<!-- Configure any options you need here -->
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PGP Signing Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<passphrase>${gpg.GPG_PASSPHRASE}</passphrase>
</configuration>
</plugin>

<!-- Maven central plugin-->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<!-- This will require manual promotion until we change this to false.-->
<!-- This is useful for testing since the artifacts will be staged and not released.-->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>

<repositories>
<repository>
<id>maven_central</id>
<id>central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
</project>
83 changes: 0 additions & 83 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,89 +36,6 @@
</repository>
</repositories>


<profiles>
<!-- Profile for deploying to maven central-->
<profile>
<id>deploy-to-maven-central-beta</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>

<build>
<!-- These plugins run when using this profile.-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>21</source>
<show>private</show>
<!-- Configure any options you need here -->
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PGP Signing Plugin-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<passphrase>${gpg.GPG_PASSPHRASE}</passphrase>
</configuration>
</plugin>

<!-- Maven central plugin-->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<!-- This will require manual promotion until we change this to false.-->
<!-- This is useful for testing since the artifacts will be staged and not released.-->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<pluginManagement>
<plugins>
Expand Down

0 comments on commit 7deaa02

Please sign in to comment.