Skip to content

Commit f596489

Browse files
committed
Adapt POM file for pushing to maven repository and CDC support.
1 parent 63f051e commit f596489

1 file changed

Lines changed: 125 additions & 11 deletions

File tree

magiclib/pom.xml

Lines changed: 125 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>org.magicdb.magic</groupId>
8+
<artifactId>magiclib</artifactId>
89
<version>1.0.0</version>
910

10-
<!-- FIXME change it to the project's website -->
11+
<name>Magic library</name>
1112
<url></url>
12-
<organization>
13-
<name>Optima SC Inc.</name>
14-
<url>http://www.optimasc.com</url>
15-
</organization>
13+
<inceptionYear>2016</inceptionYear>
14+
<description>Resource identification library based on an extensible 'magic' database.</description>
15+
16+
1617

1718

1819
<licenses>
@@ -50,11 +51,65 @@
5051
</contributor>
5152

5253
</contributors>
54+
<organization>
55+
<name>Optima SC Inc.</name>
56+
<url>http://www.optimasc.com</url>
57+
</organization>
58+
59+
<!-- TODO: The repository location : This example is for ossrh-demo under
60+
user simpligility. This is used for maven central deployment. -->
61+
<scm>
62+
<connection>scm:git:git://github.com/simpligility/ossrh-demo.git</connection>
63+
<developerConnection>scm:git:ssh://github.com:simpligility/ossrh-demo.git</developerConnection>
64+
<url>http://github.com/simpligility/ossrh-demo/tree/master</url>
65+
</scm>
66+
67+
<distributionManagement>
68+
<snapshotRepository>
69+
<id>ossrh</id>
70+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
71+
</snapshotRepository>
72+
<repository>
73+
<id>ossrh</id>
74+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
75+
</repository>
76+
</distributionManagement>
77+
78+
<!-- Define the build profiles, the default one build with JDK 1.6 runtime,
79+
other one called 'jdk14' requires JDK 1.5 or 1.6 installed and active,
80+
it permits to build java code with generics that outputs the JDK 1.4
81+
class format. It is important to understand that JDK 1.4 and JDK 1.7
82+
will assume there are no generic types when compiling with these classes.
83+
84+
See animal sniffer usage later on to ensure that the JDK 1.4 can successfully
85+
run on CDC FP systems in regards to the API's.
86+
-->
87+
<profiles>
88+
<profile>
89+
<id>default</id>
90+
<activation>
91+
<activeByDefault>true</activeByDefault>
92+
</activation>
5393
<properties>
54-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5594
<maven.compiler.source>1.6</maven.compiler.source>
5695
<maven.compiler.target>1.6</maven.compiler.target>
96+
<finalName>${project.artifactId}-${project.version}</finalName>
5797
</properties>
98+
</profile>
99+
<profile>
100+
<id>jdk14</id>
101+
<properties>
102+
<maven.compiler.source>1.5</maven.compiler.source>
103+
<maven.compiler.target>jsr14</maven.compiler.target>
104+
<finalName>${project.artifactId}-${project.version}-jdk14</finalName>
105+
</properties>
106+
</profile>
107+
</profiles>
108+
109+
<properties>
110+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
111+
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
112+
</properties>
58113

59114
<dependencies>
60115
<dependency>
@@ -66,6 +121,7 @@
66121
</dependencies>
67122

68123
<build>
124+
<finalName>${finalName}</finalName>
69125
<plugins>
70126
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
71127
<plugin>
@@ -77,9 +133,28 @@
77133
<artifactId>maven-resources-plugin</artifactId>
78134
<version>3.0.2</version>
79135
</plugin>
136+
137+
<!-- Permits to check against CDC FP 1.1 with JSR 280 API compatibility -->
138+
<!-- Call using mvn animal-sniffer:check -->
139+
<plugin>
140+
<groupId>org.codehaus.mojo</groupId>
141+
<artifactId>animal-sniffer-maven-plugin</artifactId>
142+
<version>1.8</version>
143+
<configuration>
144+
<signature>
145+
<groupId>com.optimasc.signatures</groupId>
146+
<artifactId>cdc11fpxml</artifactId>
147+
<version>1.0-SNAPSHOT</version>
148+
</signature>
149+
</configuration>
150+
</plugin>
80151
<plugin>
81152
<artifactId>maven-compiler-plugin</artifactId>
82-
<version>3.6.2</version>
153+
<version>2.3.2</version>
154+
<configuration>
155+
<source>${maven.compiler.source}</source>
156+
<target>${maven.compiler.target}</target>
157+
</configuration>
83158
</plugin>
84159
<plugin>
85160
<artifactId>maven-surefire-plugin</artifactId>
@@ -96,6 +171,9 @@
96171
<classpathPrefix>../lib/</classpathPrefix>
97172
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
98173
</manifest>
174+
<manifestEntries>
175+
<Build_Target>${maven.compiler.target}</Build_Target>
176+
</manifestEntries>
99177
</archive>
100178
</configuration>
101179
</plugin>
@@ -154,6 +232,12 @@
154232
<goal>javadoc</goal>
155233
</goals>
156234
</execution>
235+
<execution>
236+
<id>attach-javadocs</id>
237+
<goals>
238+
<goal>jar</goal>
239+
</goals>
240+
</execution>
157241
</executions>
158242
</plugin>
159243

@@ -164,6 +248,14 @@
164248
<configuration>
165249
<classifier>src</classifier>
166250
</configuration>
251+
<executions>
252+
<execution>
253+
<id>attach-sources</id>
254+
<goals>
255+
<goal>jar-no-fork</goal>
256+
</goals>
257+
</execution>
258+
</executions>
167259
</plugin>
168260

169261
<plugin>
@@ -187,6 +279,32 @@
187279
</executions>
188280
</plugin>
189281

282+
<plugin>
283+
<groupId>org.apache.maven.plugins</groupId>
284+
<artifactId>maven-gpg-plugin</artifactId>
285+
<version>1.5</version>
286+
<executions>
287+
<execution>
288+
<id>sign-artifacts</id>
289+
<phase>verify</phase>
290+
<goals>
291+
<goal>sign</goal>
292+
</goals>
293+
</execution>
294+
</executions>
295+
</plugin>
296+
297+
<plugin>
298+
<groupId>org.sonatype.plugins</groupId>
299+
<artifactId>nexus-staging-maven-plugin</artifactId>
300+
<version>1.6.7</version>
301+
<extensions>true</extensions>
302+
<configuration>
303+
<serverId>ossrh</serverId>
304+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
305+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
306+
</configuration>
307+
</plugin>
190308

191309
<plugin>
192310
<groupId>org.apache.maven.plugins</groupId>
@@ -251,8 +369,4 @@
251369
</plugins>
252370
</reporting>
253371

254-
<name>Magic library</name>
255-
<inceptionYear>2016</inceptionYear>
256-
<artifactId>magiclib</artifactId>
257-
<description>Resource identification library based on an extensible 'magic' database.</description>
258372
</project>

0 commit comments

Comments
 (0)