Skip to content

Commit

Permalink
Merge pull request #12 from spotify/psobot/fix-java-deployment
Browse files Browse the repository at this point in the history
Fix pom.xml to support deployments to Maven Central.
  • Loading branch information
psobot authored Jun 21, 2023
2 parents 9e09224 + bbb75c2 commit 9d415a2
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 64 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'
gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Compile
run: make
- name: Run Tests
run: mvn --batch-mode verify
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_PASSPHRASE }}

run-python-tests:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -264,12 +268,16 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'
gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Compile
run: make
- name: Package
run: mvn --batch-mode package
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_PASSPHRASE }}
- uses: actions/upload-artifact@v3
with:
if-no-files-found: error
Expand All @@ -288,6 +296,8 @@ jobs:
shell: bash
working-directory: artifacts
run: |
rm -fv java-*/*-sources.jar
rm -fv java-*/*-javadoc.jar
for artifact in java-*; do unzip -o $artifact/*.jar -d combined-jar; done
zip -r $(ls java-* | grep jar | tail -n 1) combined-jar/*
- uses: actions/upload-artifact@v3
Expand Down
133 changes: 69 additions & 64 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
<version>1.2.2</version>

<scm>
<url>https://github.com/spotify/voyager</url>
<connection>scm:git:[email protected]:spotify/voyager.git</connection>
<developerConnection>scm:git:[email protected]:spotify/voyager.git</developerConnection>
<tag>v1.0.0</tag>
<tag>HEAD</tag>
</scm>

<licenses>
Expand All @@ -27,6 +29,32 @@
</license>
</licenses>

<developers>
<developer>
<id>psobot</id>
<name>Peter Sobot</name>
<email>[email protected]</email>
<organization>Spotify AB</organization>
<organizationUrl>http://www.spotify.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>-5</timezone>
</developer>
<developer>
<id>dylanrb123</id>
<name>Dylan Bannon</name>
<email>[email protected]</email>
<organization>Spotify AB</organization>
<organizationUrl>http://www.spotify.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>-5</timezone>
</developer>
</developers>


<properties>
<jacoco.minimum-coverage>0.50</jacoco.minimum-coverage>
</properties>
Expand Down Expand Up @@ -127,76 +155,53 @@
<plugin>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>8</source>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>tingle</id>
<build>
<plugins>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<source>8</source>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
</plugins>
</build>
</profile>
</profiles>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 9d415a2

Please sign in to comment.