Skip to content

Commit a14bacc

Browse files
committed
release with travis
1 parent 7ae368f commit a14bacc

File tree

5 files changed

+147
-8
lines changed

5 files changed

+147
-8
lines changed

.travis.yml

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
language: java
22
sudo: false
3+
34
jdk:
4-
- openjdk7
5-
- oraclejdk7
6-
5+
- oraclejdk8
6+
7+
install:
8+
- mvn --settings .travis/settings.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
9+
10+
before_install:
11+
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import; fi
12+
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
13+
714
after_success:
815
- mvn clean cobertura:cobertura -Dcobertura.report.format=xml org.eluder.coveralls:coveralls-maven-plugin:3.0.1:report
16+
917
notifications:
1018
email: false
19+
20+
deploy:
21+
- provider: script
22+
script: .travis/deploy.sh
23+
skip_cleanup: true
24+
on:
25+
repo: VerbalExpressions/JavaVerbalExpressions
26+
branch: master
27+
- provider: script
28+
script: .travis/deploy.sh
29+
skip_cleanup: true
30+
on:
31+
repo: VerbalExpressions/JavaVerbalExpressions
32+
tags: true
33+
34+
35+
cache:
36+
directories:
37+
- $HOME/.m2

.travis/deploy.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
if [ ! -z "$TRAVIS_TAG" ]
3+
then
4+
echo "on a tag -> set pom.xml <version> to $TRAVIS_TAG"
5+
mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$TRAVIS_TAG 1>/dev/null 2>/dev/null
6+
else
7+
echo "not on a tag -> keep SNAPSHOT version in pom.xml"
8+
fi
9+
10+
mvn clean deploy --settings .travis/settings.xml -DskipTests=true -B -U

.travis/settings.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
<servers>
6+
<server>
7+
<!-- Maven Central Deployment -->
8+
<id>ossrh</id>
9+
<username>${env.SONATYPE_USERNAME}</username>
10+
<password>${env.SONATYPE_PASSWORD}</password>
11+
</server>
12+
</servers>
13+
<profiles>
14+
<profile>
15+
<id>ossrh</id>
16+
<activation>
17+
<activeByDefault>true</activeByDefault>
18+
</activation>
19+
<properties>
20+
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
21+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
22+
</properties>
23+
</profile>
24+
</profiles>
25+
</settings>

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,8 @@ You can view all implementations on [VerbalExpressions.github.io](http://VerbalE
108108
[Groovy](https://github.com/VerbalExpressions/GroovyVerbalExpressions) -
109109
[Haskell](https://github.com/VerbalExpressions/HaskellVerbalExpressions) -
110110
[C++](https://github.com/VerbalExpressions/CppVerbalExpressions) - ... ([moarr](https://github.com/VerbalExpressions)) ]
111+
112+
## Project released with travis
113+
114+
With help of this tutorial:
115+
https://dracoblue.net/dev/uploading-snapshots-and-releases-to-maven-central-with-travis/

pom.xml

+77-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>org.sonatype.oss</groupId>
5-
<artifactId>oss-parent</artifactId>
6-
<version>9</version>
7-
</parent>
83

94
<groupId>ru.lanwen.verbalregex</groupId>
105
<artifactId>java-verbal-expressions</artifactId>
@@ -115,4 +110,81 @@
115110
</plugins>
116111
</reporting>
117112

113+
<distributionManagement>
114+
<snapshotRepository>
115+
<id>ossrh</id>
116+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
117+
</snapshotRepository>
118+
<repository>
119+
<id>ossrh</id>
120+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
121+
</repository>
122+
</distributionManagement>
123+
124+
<profiles>
125+
<profile>
126+
<id>deployment</id>
127+
<activation>
128+
<activeByDefault>true</activeByDefault>
129+
</activation>
130+
<build>
131+
<plugins>
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-gpg-plugin</artifactId>
135+
<version>1.5</version>
136+
<executions>
137+
<execution>
138+
<id>sign-artifacts</id>
139+
<phase>verify</phase>
140+
<goals>
141+
<goal>sign</goal>
142+
</goals>
143+
</execution>
144+
</executions>
145+
</plugin>
146+
<plugin>
147+
<groupId>org.sonatype.plugins</groupId>
148+
<artifactId>nexus-staging-maven-plugin</artifactId>
149+
<version>1.6.3</version>
150+
<extensions>true</extensions>
151+
<configuration>
152+
<serverId>ossrh</serverId>
153+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
154+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
155+
</configuration>
156+
</plugin>
157+
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-source-plugin</artifactId>
161+
<version>2.2.1</version>
162+
<executions>
163+
<execution>
164+
<id>attach-sources</id>
165+
<goals>
166+
<goal>jar-no-fork</goal>
167+
</goals>
168+
</execution>
169+
</executions>
170+
</plugin>
171+
172+
<plugin>
173+
<groupId>org.apache.maven.plugins</groupId>
174+
<artifactId>maven-javadoc-plugin</artifactId>
175+
<version>2.9.1</version>
176+
<executions>
177+
<execution>
178+
<id>attach-javadocs</id>
179+
<goals>
180+
<goal>jar</goal>
181+
</goals>
182+
</execution>
183+
</executions>
184+
</plugin>
185+
</plugins>
186+
</build>
187+
</profile>
188+
</profiles>
189+
118190
</project>

0 commit comments

Comments
 (0)