Skip to content

Commit

Permalink
Added auto deploy for sonatype (#386)
Browse files Browse the repository at this point in the history
* Added auto deploy for sonatype
* Updated group id to GitHub related
* Added sudo to travis
  • Loading branch information
garethahealy authored May 25, 2017
1 parent 9740920 commit 2483cb3
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 26 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
sudo: required
dist: trusty
env:
global:
- secure: Izz+xWjTzSTMwJZJ0eFGVk0YTWnDWbXfqn3KShzevSeUIm/qxrGs9by/ATc1OouvM209ZLAKu6QBamrOEztfswZFFOgE2bNoF62Wh8X4rpeKBXrrqbsMZigcV4Y1dt/cMxioCLNSdEerQ252RWL8ILNW6zEo5/Tg82/sZmudIjE=
- secure: by3EqA+ceJedtsog127U7eqyZMMokxiSJuFwS9XUQ81BqvThmxNOu6ZS+oE1XC0XHJ5dfzO1bWlzedChP1bSM8Tq+tmeddtnbMgcdLDgQD2tLSncVBZerjJuN4P+wVOVKHjK0uaXKxH3To1q3psSxAPUJF0Hem6BOOeZoFZsui4=
- secure: ipsjLktGbYJhOu6aEuikws80SRfKxQ17I4Vyn92DRh6T/itITBzf8npH5hvPC/A1kUct3ZcxibkMFmC9DZ5qJrMeR2jSYRY2UW3GDAeNBal1flQAItGwcTuDVrxowS5d1QhCT0I/oMZNCScRkgLorZARCd62vGqD8xQCvMXlqis=
- secure: NESSqQhlo74FQix3wQNU1Gatk1igv3w4o0EIfQq5aXEEGoaLdDnF2hGdivkEINYzM3pEU6cpy5+N+njcONGKS9NnBEe8tA2Ngk1cKW+I/rScwS4jCBbA7FpdOagecWB3kb62uL8qS7Iu50v6HrKPjakioFwm9gAu2TE8WLgx0Pg=
language: java
jdk:
- oraclejdk8
before_install:
- bash .travis/deploy-codesigning.sh
install:
- java -version && javac -version && mvn -version -B
before_script:
Expand All @@ -10,6 +19,10 @@ script:
- mvn clean install -B
after_success:
- mvn test -Dtest=PerformanceTest -DfailIfNoTests=false -DargLine="-DnumIters=25000"
deploy:
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
cache:
directories:
- $HOME/.m2
Binary file added .travis/codesigning.asc.enc
Binary file not shown.
10 changes: 10 additions & 0 deletions .travis/deploy-codesigning.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

echo "Deploying code signing key..."

cd ./.travis || exit

openssl aes-256-cbc -K "$encrypted_1b2eb614f966_key" -iv "$encrypted_1b2eb614f966_iv" -in codesigning.asc.enc -out codesigning.asc -d
gpg --fast-import codesigning.asc

cd ../ || exit
22 changes: 22 additions & 0 deletions .travis/deploy-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
7 changes: 7 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ "${TRAVIS_BRANCH}" = "master" ]] && [[ "${TRAVIS_PULL_REQUEST}" = "false" ]];
then
echo "About to deploy..."
mvn deploy -B -Prelease-ossrh -DskipTests --settings .travis/deploy-settings.xml
fi
2 changes: 1 addition & 1 deletion bom-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
Expand Down
2 changes: 1 addition & 1 deletion building-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
</parent>
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-plugins-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../plugins-parent</relativePath>
</parent>

<artifactId>dozer</artifactId>
<artifactId>dozer-core</artifactId>
<packaging>bundle</packaging>
<name>Dozer :: Core</name>

Expand Down
2 changes: 1 addition & 1 deletion osgi-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-plugins-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../plugins-parent</relativePath>
Expand Down
12 changes: 3 additions & 9 deletions plugins-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
Expand Down Expand Up @@ -57,7 +57,6 @@
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
<jaxb2-maven-plugin.version>2.3.1</jaxb2-maven-plugin.version>
<versions-maven-plugin.version>2.3</versions-maven-plugin.version>
<xmlbeans-maven-plugin.version>2.3.3</xmlbeans-maven-plugin.version>

<!-- OSGi Plugins versions; alphabetical order -->
Expand Down Expand Up @@ -218,11 +217,6 @@
<artifactId>jaxb2-maven-plugin</artifactId>
<version>${jaxb2-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
Expand Down Expand Up @@ -342,7 +336,7 @@
<artifactId>findbugs-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>building-tools</artifactId>
<version>${building-tools.version}</version>
<scope>compile</scope>
Expand All @@ -368,7 +362,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>building-tools</artifactId>
<version>${building-tools.version}</version>
<scope>compile</scope>
Expand Down
65 changes: 55 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,25 @@

<modelVersion>4.0.0</modelVersion>

<groupId>net.sf.dozer</groupId>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
<relativePath/>
</parent>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-parent</artifactId>
<packaging>pom</packaging>
<version>6.0.0-SNAPSHOT</version>
<url>http://dozer.sourceforge.net</url>
<name>Dozer :: Parent</name>
<description>Dozer is a powerful Java Bean to Java Bean mapper that recursively copies data from one object to another</description>
<inceptionYear>2005</inceptionYear>

<organization>
<name>dozer</name>
<url>https://github.com/DozerMapper/dozer</url>
</organization>

<inceptionYear>2005</inceptionYear>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand Down Expand Up @@ -95,6 +100,8 @@
<maven-assembly-plugin.version>3.0.0</maven-assembly-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
<versions-maven-plugin.version>2.3</versions-maven-plugin.version>

<building-tools.version>6.0.0-SNAPSHOT</building-tools.version>
</properties>
Expand All @@ -113,11 +120,21 @@
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${license-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>

Expand All @@ -138,6 +155,7 @@
<excludes>
<exclude>docs/**</exclude>
<exclude>website/**</exclude>
<exclude>.travis/**</exclude>
<exclude>LICENSE-HEADER.txt</exclude>
<exclude>LICENSE.md</exclude>
<exclude>README.md</exclude>
Expand Down Expand Up @@ -178,15 +196,10 @@

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<id>release-ossrh</id>
<build>
<plugins>
<!-- Alphabetical order -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -200,8 +213,40 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>

Expand Down
2 changes: 1 addition & 1 deletion proto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-plugins-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../plugins-parent</relativePath>
Expand Down
2 changes: 1 addition & 1 deletion spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-plugins-parent</artifactId>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../plugins-parent</relativePath>
Expand Down

0 comments on commit 2483cb3

Please sign in to comment.