Skip to content

Commit 679fe19

Browse files
committed
Configure project for Sonatype OSSRH and Maven Central deployment
1 parent 03c297d commit 679fe19

File tree

3 files changed

+188
-140
lines changed

3 files changed

+188
-140
lines changed

Diff for: .travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
language: java
22
jdk:
3-
- oraclejdk8
3+
- oraclejdk8
4+
5+
deploy:
6+
provider: script
7+
script: mvn deploy -Dmaven.test.skip -s settings.xml
8+
on:
9+
branch: develop

Diff for: pom.xml

+172-139
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,79 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
6-
<prerequisites>
7-
<maven>3.0.0</maven>
8-
</prerequisites>
9-
10-
<groupId>org.omnifaces</groupId>
11-
<artifactId>omnipersistence</artifactId>
12-
<version>0.1-SNAPSHOT</version>
13-
14-
<name>OmniPersistence</name>
15-
<description>Utilities for JPA, JDBC and DataSources</description>
16-
17-
<url>http://omnifaces.org</url>
18-
<organization>
19-
<name>OmniFaces</name>
20-
<url>http://omnifaces.org</url>
21-
</organization>
22-
<inceptionYear>2015</inceptionYear>
23-
24-
<repositories>
25-
<repository>
26-
<id>ossrh-snapshots</id>
27-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
28-
</repository>
29-
</repositories>
30-
31-
<licenses>
32-
<license>
33-
<name>The Apache Software License, Version 2.0</name>
34-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
35-
<distribution>repo</distribution>
36-
</license>
37-
</licenses>
38-
39-
<scm>
40-
<url>https://github.com/omnifaces/omnipersistence</url>
41-
<connection>scm:git:git://github.com/omnifaces/omnipersistence.git</connection>
42-
<developerConnection>scm:git:[email protected]:omnifaces/omnipersistence.git</developerConnection>
43-
</scm>
44-
45-
<properties>
46-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
47-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
48-
<javase.version>1.8</javase.version>
49-
<javaee.version>7.0</javaee.version>
50-
</properties>
51-
52-
<developers>
53-
<developer>
54-
<id>balusc</id>
55-
<name>Bauke Scholtz</name>
56-
<email>[email protected]</email>
57-
</developer>
58-
59-
<developer>
60-
<id>arjan.tijms</id>
61-
<name>Arjan Tijms</name>
62-
<email>[email protected]</email>
63-
</developer>
64-
65-
<developer>
66-
<id>jan.beernink</id>
67-
<name>Jan Beernink</name>
68-
<email>[email protected]</email>
69-
</developer>
70-
</developers>
5+
<modelVersion>4.0.0</modelVersion>
6+
<prerequisites>
7+
<maven>3.0.0</maven>
8+
</prerequisites>
9+
10+
<groupId>org.omnifaces</groupId>
11+
<artifactId>omnipersistence</artifactId>
12+
<version>0.1-SNAPSHOT</version>
13+
14+
<name>OmniPersistence</name>
15+
<description>Utilities for JPA, JDBC and DataSources</description>
16+
17+
<url>http://omnifaces.org</url>
18+
<organization>
19+
<name>OmniFaces</name>
20+
<url>http://omnifaces.org</url>
21+
</organization>
22+
<inceptionYear>2015</inceptionYear>
23+
24+
<repositories>
25+
<repository>
26+
<id>ossrh-snapshots</id>
27+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
28+
</repository>
29+
</repositories>
30+
31+
<distributionManagement>
32+
<snapshotRepository>
33+
<id>ossrh</id>
34+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
35+
</snapshotRepository>
36+
</distributionManagement>
37+
38+
<licenses>
39+
<license>
40+
<name>The Apache Software License, Version 2.0</name>
41+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
42+
<distribution>repo</distribution>
43+
</license>
44+
</licenses>
45+
46+
<scm>
47+
<url>https://github.com/omnifaces/omnipersistence</url>
48+
<connection>scm:git:git://github.com/omnifaces/omnipersistence.git</connection>
49+
<developerConnection>scm:git:[email protected]:omnifaces/omnipersistence.git</developerConnection>
50+
</scm>
51+
52+
<properties>
53+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
54+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
55+
<javase.version>1.8</javase.version>
56+
<javaee.version>7.0</javaee.version>
57+
</properties>
58+
59+
<developers>
60+
<developer>
61+
<id>balusc</id>
62+
<name>Bauke Scholtz</name>
63+
<email>[email protected]</email>
64+
</developer>
65+
66+
<developer>
67+
<id>arjan.tijms</id>
68+
<name>Arjan Tijms</name>
69+
<email>[email protected]</email>
70+
</developer>
71+
72+
<developer>
73+
<id>jan.beernink</id>
74+
<name>Jan Beernink</name>
75+
<email>[email protected]</email>
76+
</developer>
77+
</developers>
7178

7279
<dependencies>
7380
<dependency>
@@ -79,8 +86,8 @@
7986

8087
<dependency>
8188
<groupId>org.omnifaces</groupId>
82-
<artifactId>omniutils</artifactId>
83-
<version>0.2-SNAPSHOT</version>
89+
<artifactId>omniutils</artifactId>
90+
<version>0.2-SNAPSHOT</version>
8491
</dependency>
8592

8693
<!-- TODO: Some code is now Hibernate specific.
@@ -94,75 +101,101 @@
94101
</dependency>
95102
</dependencies>
96103

97-
<build>
98-
<plugins>
99-
100-
<!-- Set the Java compiler versions -->
101-
<plugin>
102-
<groupId>org.apache.maven.plugins</groupId>
103-
<artifactId>maven-compiler-plugin</artifactId>
104-
<version>3.3</version>
105-
<configuration>
106-
<source>${javase.version}</source>
107-
<target>${javase.version}</target>
108-
</configuration>
109-
</plugin>
110-
111-
<!-- Configure the jar with the binaries -->
112-
<plugin>
113-
<groupId>org.apache.maven.plugins</groupId>
114-
<artifactId>maven-jar-plugin</artifactId>
115-
<version>2.6</version>
116-
<configuration>
117-
<archive>
118-
<manifest>
119-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
120-
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
121-
</manifest>
122-
<manifestEntries>
123-
<URL>${project.url}</URL>
124-
<Extension-Name>${project.artifactId}</Extension-Name>
125-
</manifestEntries>
126-
</archive>
127-
</configuration>
128-
</plugin>
129-
130-
<!-- Configure the jar with the sources (or rather, convince Maven that we want sources at all) -->
131-
<plugin>
132-
<groupId>org.apache.maven.plugins</groupId>
133-
<artifactId>maven-source-plugin</artifactId>
134-
<version>2.4</version>
135-
<executions>
136-
<execution>
137-
<id>attach-sources</id>
138-
<goals>
139-
<goal>jar-no-fork</goal>
140-
</goals>
141-
</execution>
142-
</executions>
143-
</plugin>
144-
145-
<!-- Configure the jar with the javadoc (or rather, convince Maven that we want javadoc at all) -->
146-
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-javadoc-plugin</artifactId>
149-
<version>2.10.3</version>
150-
<configuration>
151-
<javadocVersion>1.8</javadocVersion>
152-
<notimestamp>true</notimestamp>
153-
<splitindex>true</splitindex>
154-
<doctitle>OmniPersistence API documentation</doctitle>
155-
</configuration>
156-
<executions>
157-
<execution>
158-
<id>attach-javadocs</id>
159-
<goals>
160-
<goal>jar</goal>
161-
</goals>
162-
</execution>
163-
</executions>
164-
</plugin>
165-
166-
</plugins>
167-
</build>
104+
<build>
105+
<plugins>
106+
107+
<!-- Set the Java compiler versions -->
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-compiler-plugin</artifactId>
111+
<version>3.3</version>
112+
<configuration>
113+
<source>${javase.version}</source>
114+
<target>${javase.version}</target>
115+
</configuration>
116+
</plugin>
117+
118+
<!-- Configure the jar with the binaries -->
119+
<plugin>
120+
<groupId>org.apache.maven.plugins</groupId>
121+
<artifactId>maven-jar-plugin</artifactId>
122+
<version>2.6</version>
123+
<configuration>
124+
<archive>
125+
<manifest>
126+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
127+
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
128+
</manifest>
129+
<manifestEntries>
130+
<URL>${project.url}</URL>
131+
<Extension-Name>${project.artifactId}</Extension-Name>
132+
</manifestEntries>
133+
</archive>
134+
</configuration>
135+
</plugin>
136+
137+
<!-- Configure the jar with the sources (or rather, convince Maven that we want sources at all) -->
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-source-plugin</artifactId>
141+
<version>2.4</version>
142+
<executions>
143+
<execution>
144+
<id>attach-sources</id>
145+
<goals>
146+
<goal>jar-no-fork</goal>
147+
</goals>
148+
</execution>
149+
</executions>
150+
</plugin>
151+
152+
<!-- Configure the jar with the javadoc (or rather, convince Maven that we want javadoc at all) -->
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-javadoc-plugin</artifactId>
156+
<version>2.10.3</version>
157+
<configuration>
158+
<javadocVersion>1.8</javadocVersion>
159+
<notimestamp>true</notimestamp>
160+
<splitindex>true</splitindex>
161+
<doctitle>OmniPersistence API documentation</doctitle>
162+
</configuration>
163+
<executions>
164+
<execution>
165+
<id>attach-javadocs</id>
166+
<goals>
167+
<goal>jar</goal>
168+
</goals>
169+
</execution>
170+
</executions>
171+
</plugin>
172+
173+
</plugins>
174+
</build>
175+
176+
177+
<profiles>
178+
<profile>
179+
<id>release</id>
180+
<build>
181+
<plugins>
182+
<!-- Signing with GPG is a requirement for a release deployment (to Maven central) -->
183+
<plugin>
184+
<groupId>org.apache.maven.plugins</groupId>
185+
<artifactId>maven-gpg-plugin</artifactId>
186+
<version>1.5</version>
187+
<executions>
188+
<execution>
189+
<id>sign-artifacts</id>
190+
<phase>verify</phase>
191+
<goals>
192+
<goal>sign</goal>
193+
</goals>
194+
</execution>
195+
</executions>
196+
</plugin>
197+
</plugins>
198+
</build>
199+
</profile>
200+
</profiles>
168201
</project>

Diff for: settings.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
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>

0 commit comments

Comments
 (0)