First attempt at deploying snapshots to maven central

This commit is contained in:
Endolf 2018-05-23 20:12:22 +01:00
parent 5b0cafeb36
commit 4731a08964
2 changed files with 42 additions and 34 deletions

24
Jenkinsfile vendored
View file

@ -54,10 +54,8 @@ pipeline {
}
}
}
stage('Unpack') {
agent {
label "linux"
}
stage('Archive artifacts') {
agent any
steps {
unstash 'core-artifacts'
unstash 'windows-artifacts'
@ -70,5 +68,23 @@ pipeline {
}
}
}
stage('Deploy artifacts') {
agent {
label "linux"
}
steps {
unstash 'core-artifacts'
unstash 'windows-artifacts'
unstash 'osx-artifacts'
unstash 'linux-artifacts'
sh 'echo $GPG_SECRET_KEYS | base64 --decode | gpg --import'
sh 'echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust'
withMaven(
mavenSettingsConfig: 'maven-central'
) {
sh "mvn deploy"
}
}
}
}
}

52
pom.xml
View file

@ -26,6 +26,17 @@
<developerConnection>scm:git:https://github.com/jinput/jinput.git</developerConnection>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
@ -133,36 +144,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>