Skip to content

Commit de13be7

Browse files
author
bddgeyte
committed
Test automated release
1 parent b33013f commit de13be7

6 files changed

Lines changed: 106 additions & 233 deletions

File tree

.travis.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
language: java
2-
sudo: false
3-
jdk:
4-
- oraclejdk7
5-
2+
jdk: openjdk7
3+
branches:
4+
only:
5+
- master
66
cache:
77
directories:
8-
- $HOME/.m2
9-
10-
# branches blacklist
11-
branches:
12-
except:
13-
- gh-pages
14-
- mvn-repo
15-
16-
# custom build script and deployment
17-
before_install: chmod +x script/deploy.sh
18-
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
19-
after_success: travis_wait 60 ./script/deploy.sh
20-
21-
deploy:
22-
provider: releases
23-
api-key: ${OAUTH2_DEPLOY_TOKEN}
24-
file-glob: true
25-
file: target/teamspeak3-api-*.jar
26-
skip_cleanup: true
27-
on:
28-
tags: true
29-
8+
- "$HOME/.m2"
9+
env:
10+
global:
11+
- GPG_DIR="`pwd`/deploy"
3012
notifications:
3113
email:
3214
on_success: never
3315
on_failure: always
16+
after_success:
17+
- openssl aes-256-cbc -K $encrypted_37c44ba70a11_key -iv $encrypted_37c44ba70a11_iv -in $GPG_DIR/secring.gpg.enc -out $GPG_DIR/secring.gpg -d
18+
- openssl aes-256-cbc -K $encrypted_37c44ba70a11_key -iv $encrypted_37c44ba70a11_iv -in $GPG_DIR/pubring.gpg.enc -out $GPG_DIR/pubring.gpg -d
19+
- "$GPG_DIR/publish.sh"

deploy/publish.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then
4+
mvn deploy --settings $GPG_DIR/settings.xml -DperformRelease=true -DskipTests=true
5+
exit $?
6+
fi

deploy/pubring.gpg.enc

1.19 KB
Binary file not shown.

deploy/secring.gpg.enc

2.46 KB
Binary file not shown.

deploy/settings.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<settings>
2+
<servers>
3+
<server>
4+
<id>ossrh</id>
5+
<username>${env.SONATYPE_USERNAME}</username>
6+
<password>${env.SONATYPE_PASSWORD}</password>
7+
</server>
8+
</servers>
9+
</settings>

pom.xml

Lines changed: 79 additions & 207 deletions
Original file line numberDiff line numberDiff line change
@@ -48,234 +48,106 @@
4848
</issueManagement>
4949

5050
<properties>
51-
<!-- github server corresponds to entry in ~/.m2/settings.xml -->
52-
<github.global.server>github</github.global.server>
5351
<encoding>UTF-8</encoding>
5452
</properties>
5553

5654
<build>
5755
<plugins>
58-
<!-- Phase: COMPILE -->
59-
<!-- Update license headers -->
60-
<plugin>
61-
<groupId>org.codehaus.mojo</groupId>
62-
<artifactId>license-maven-plugin</artifactId>
63-
<version>1.7</version>
64-
<executions>
65-
<execution>
66-
<id>first</id>
67-
<goals>
68-
<goal>update-file-header</goal>
69-
</goals>
70-
<phase>process-sources</phase>
71-
<configuration>
72-
<encoding>UTF-8</encoding>
73-
<licenseName>mit</licenseName>
74-
<inceptionYear>2014</inceptionYear>
75-
<organizationName>Bert De Geyter, Roger Baumgartner</organizationName>
76-
<projectName>TeamSpeak 3 Java API</projectName>
77-
<includes>
78-
<include>**/*.java</include>
79-
</includes>
80-
</configuration>
81-
</execution>
82-
</executions>
83-
</plugin>
84-
<!-- Compile java sources with JDK 1.7 -->
8556
<plugin>
8657
<artifactId>maven-compiler-plugin</artifactId>
87-
<version>3.1</version>
58+
<version>3.6.1</version>
8859
<configuration>
8960
<source>1.7</source>
9061
<target>1.7</target>
9162
</configuration>
9263
</plugin>
93-
<!-- PHASE: Package -->
94-
<!-- [IMPLIED BY PACKAGING] Package compiled class files into jar -->
95-
<!-- Generate sources jar -->
96-
<plugin>
97-
<groupId>org.apache.maven.plugins</groupId>
98-
<artifactId>maven-source-plugin</artifactId>
99-
<version>2.2.1</version>
100-
<executions>
101-
<execution>
102-
<id>sources-jar</id>
103-
<goals>
104-
<goal>jar-no-fork</goal>
105-
</goals>
106-
</execution>
107-
</executions>
108-
</plugin>
109-
<!-- Generate javadoc directory /apidocs/<version> and pack into jar -->
110-
<plugin>
111-
<groupId>org.apache.maven.plugins</groupId>
112-
<artifactId>maven-javadoc-plugin</artifactId>
113-
<version>2.9.1</version>
114-
<configuration> <!-- If someone else decides to run javadoc:javadoc -->
115-
<quiet>true</quiet>
116-
<show>public</show>
117-
<linksource>true</linksource>
118-
<tags>
119-
<tag>
120-
<name>querycommands</name>
121-
<placement>m</placement>
122-
<head>Number of query commands sent:</head>
123-
</tag>
124-
</tags>
125-
</configuration>
126-
<executions>
127-
<execution>
128-
<id>javadoc-jar</id>
129-
<goals>
130-
<goal>jar</goal>
131-
</goals>
132-
<configuration>
133-
<outputDirectory>${project.build.directory}/apidocs/${project.version}/</outputDirectory>
134-
</configuration>
135-
</execution>
136-
</executions>
137-
</plugin>
138-
<!-- PHASE: Deploy -->
139-
<!-- Copy HTML files from /src/site to /target/apidocs -->
140-
<plugin>
141-
<artifactId>maven-resources-plugin</artifactId>
142-
<version>2.6</version>
143-
<executions>
144-
<execution>
145-
<id>copy-site</id>
146-
<phase>deploy</phase>
147-
<goals>
148-
<goal>copy-resources</goal>
149-
</goals>
150-
<configuration>
151-
<outputDirectory>${project.build.directory}/apidocs</outputDirectory>
152-
<resources>
153-
<resource>
154-
<directory>${project.basedir}/src/site</directory>
155-
<include>**</include>
156-
<filtering>true</filtering>
157-
</resource>
158-
</resources>
159-
</configuration>
160-
</execution>
161-
</executions>
162-
</plugin>
163-
<!-- Create file version of a maven repository in /mvn-repo -->
164-
<plugin>
165-
<artifactId>maven-deploy-plugin</artifactId>
166-
<version>2.8.1</version>
167-
<configuration>
168-
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
169-
</configuration>
170-
</plugin>
171-
<!-- Upload first /mvn-repo, then /apidocs to GitHub -->
172-
<plugin>
173-
<groupId>com.github.github</groupId>
174-
<artifactId>site-maven-plugin</artifactId>
175-
<version>0.12</version>
176-
<executions>
177-
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
178-
<execution>
179-
<id>deploy-maven-repository</id>
180-
<configuration>
181-
<message>Maven artifacts for ${project.version}</message> <!-- git commit message -->
182-
<merge>true</merge>
183-
<noJekyll>true</noJekyll> <!-- disable webpage processing -->
184-
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
185-
<branch>refs/heads/mvn-repo</branch> <!-- remote branch name -->
186-
<includes>
187-
<include>**/*</include>
188-
</includes>
189-
<repositoryName>TeamSpeak-3-Java-API</repositoryName> <!-- github repo name -->
190-
<repositoryOwner>TheHolyWaffle</repositoryOwner> <!-- github username -->
191-
</configuration>
192-
<goals>
193-
<goal>site</goal>
194-
</goals>
195-
<phase>deploy</phase>
196-
</execution>
197-
<execution>
198-
<id>deploy-javadoc</id>
199-
<configuration>
200-
<skip>${snapshotBuild}</skip>
201-
<message>Javadoc for ${project.version}</message> <!-- git commit message -->
202-
<merge>true</merge>
203-
<noJekyll>true</noJekyll> <!-- disable webpage processing -->
204-
<outputDirectory>${project.build.directory}/apidocs</outputDirectory> <!-- matches distribution management repository url above -->
205-
<branch>refs/heads/gh-pages</branch> <!-- remote branch name -->
206-
<includes>
207-
<include>**/*</include>
208-
</includes>
209-
<repositoryName>TeamSpeak-3-Java-API</repositoryName> <!-- github repo name -->
210-
<repositoryOwner>TheHolyWaffle</repositoryOwner> <!-- github username -->
211-
</configuration>
212-
<goals>
213-
<goal>site</goal>
214-
</goals>
215-
<phase>deploy</phase>
216-
</execution>
217-
</executions>
218-
</plugin>
21964
</plugins>
220-
221-
<pluginManagement>
222-
<plugins>
223-
<!--This plugin's configuration is used to store Eclipse m2e settings
224-
only. It has no influence on the Maven build itself. -->
225-
<plugin>
226-
<groupId>org.eclipse.m2e</groupId>
227-
<artifactId>lifecycle-mapping</artifactId>
228-
<version>1.0.0</version>
229-
<configuration>
230-
<lifecycleMappingMetadata>
231-
<pluginExecutions>
232-
<pluginExecution>
233-
<pluginExecutionFilter>
234-
<groupId>
235-
org.codehaus.mojo
236-
</groupId>
237-
<artifactId>
238-
license-maven-plugin
239-
</artifactId>
240-
<versionRange>
241-
[1.7,)
242-
</versionRange>
243-
<goals>
244-
<goal>
245-
update-file-header
246-
</goal>
247-
</goals>
248-
</pluginExecutionFilter>
249-
<action>
250-
<execute />
251-
</action>
252-
</pluginExecution>
253-
</pluginExecutions>
254-
</lifecycleMappingMetadata>
255-
</configuration>
256-
</plugin>
257-
</plugins>
258-
</pluginManagement>
25965
</build>
26066

26167
<profiles>
26268
<profile>
263-
<id>default</id>
264-
<activation>
265-
<activeByDefault>true</activeByDefault>
266-
</activation>
69+
<id>ossrh</id>
26770
<properties>
268-
<snapshotBuild>false</snapshotBuild>
71+
<gpg.executable>gpg</gpg.executable>
72+
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
73+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
74+
<gpg.defaultKeyring>false</gpg.defaultKeyring>
75+
<gpg.publicKeyring>${env.GPG_DIR}/pubring.gpg</gpg.publicKeyring>
76+
<gpg.secretKeyring>${env.GPG_DIR}/secring.gpg</gpg.secretKeyring>
26977
</properties>
270-
</profile>
271-
<profile>
272-
<id>snapshot</id>
27378
<activation>
274-
<activeByDefault>false</activeByDefault>
79+
<property>
80+
<name>performRelease</name>
81+
<value>true</value>
82+
</property>
27583
</activation>
276-
<properties>
277-
<snapshotBuild>true</snapshotBuild>
278-
</properties>
84+
<build>
85+
<plugins>
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-source-plugin</artifactId>
89+
<version>3.0.1</version>
90+
<executions>
91+
<execution>
92+
<id>attach-sources</id>
93+
<goals>
94+
<goal>jar-no-fork</goal>
95+
</goals>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-javadoc-plugin</artifactId>
102+
<version>2.10.4</version>
103+
<executions>
104+
<execution>
105+
<id>attach-javadocs</id>
106+
<goals>
107+
<goal>jar</goal>
108+
</goals>
109+
</execution>
110+
</executions>
111+
</plugin>
112+
<plugin>
113+
<groupId>org.apache.maven.plugins</groupId>
114+
<artifactId>maven-gpg-plugin</artifactId>
115+
<version>1.6</version>
116+
<executions>
117+
<execution>
118+
<id>sign-artifacts</id>
119+
<phase>verify</phase>
120+
<goals>
121+
<goal>sign</goal>
122+
</goals>
123+
</execution>
124+
</executions>
125+
</plugin>
126+
<plugin>
127+
<groupId>org.sonatype.plugins</groupId>
128+
<artifactId>nexus-staging-maven-plugin</artifactId>
129+
<version>1.6.8</version>
130+
<extensions>true</extensions>
131+
<configuration>
132+
<serverId>ossrh</serverId>
133+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
134+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
135+
</configuration>
136+
</plugin>
137+
</plugins>
138+
</build>
279139
</profile>
280140
</profiles>
141+
142+
<distributionManagement>
143+
<snapshotRepository>
144+
<id>ossrh</id>
145+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
146+
</snapshotRepository>
147+
<repository>
148+
<id>ossrh</id>
149+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
150+
</repository>
151+
</distributionManagement>
152+
281153
</project>

0 commit comments

Comments
 (0)