Clean up parent pom.
[lgpl/argeo-commons.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 6d04603025bc8c4f80c564a9c1a07e456d81d6ff..09e6d40f98de185da089e667045eed2187dac196 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
+<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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.argeo.commons</groupId>
        <artifactId>argeo-commons</artifactId>
@@ -15,6 +17,8 @@
                <argeo.rpm.stagingRepository>/srv/rpmfactory/argeo-osgi-2/el7</argeo.rpm.stagingRepository>
                <!-- Encoding, see http://is.gd/mvn_source_encoding -->
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+               <!-- Timestamp -->
+               <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
                <project.scm.id>code.argeo.org</project.scm.id>
        </properties>
        <modules>
@@ -106,6 +110,9 @@ limitations under the License.
                                <excludes>
                                        <exclude>.*</exclude>
                                        <exclude>.*/**</exclude>
+                                       <!-- MANIFEST is set explicitly in the jar plugin configuration. We 
+                                               don't copy it in order to avoid side-effects with BND -->
+                                       <exclude>META-INF/MANIFEST.MF</exclude>
                                        <exclude>src/**</exclude>
                                        <exclude>ext/**</exclude>
                                        <exclude>target/**</exclude>
@@ -136,12 +143,9 @@ limitations under the License.
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <version>3.8.1</version>
                                        <configuration>
-                                               <!-- <source>1.8</source> -->
                                                <source>11</source>
                                                <target>1.8</target>
                                                <compilerId>eclipse</compilerId>
-                                               <!-- Required for compliance level, see http://jira.codehaus.org/browse/PLXCOMP-231 -->
-                                               <!-- <optimize>true</optimize> -->
                                                <!-- Hack to work around issues with generated annotations : -->
                                                <generatedSourcesDirectory>target/classes</generatedSourcesDirectory>
                                                <generatedTestSourcesDirectory>target/test-classes</generatedTestSourcesDirectory>
@@ -162,16 +166,6 @@ limitations under the License.
                                <plugin>
                                        <artifactId>maven-clean-plugin</artifactId>
                                        <version>2.6.1</version>
-                                       <configuration>
-                                               <filesets>
-                                                       <fileset>
-                                                               <directory>META-INF</directory>
-                                                               <includes>
-                                                                       <include>MANIFEST.MF</include>
-                                                               </includes>
-                                                       </fileset>
-                                               </filesets>
-                                       </configuration>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-surefire-plugin</artifactId>
@@ -243,35 +237,27 @@ limitations under the License.
                                        <extensions>true</extensions>
                                        <configuration>
                                                <manifestLocation>META-INF</manifestLocation>
+                                               <niceManifest>true</niceManifest>
+                                               <noWarningProjectTypes>
+                                                       <noWarningProjectType>pom</noWarningProjectType>
+                                               </noWarningProjectTypes>
                                                <instructions>
                                                        <_include>bnd.bnd</_include>
-                                                       <Bundle-Version>${project.version}-r${tstamp}</Bundle-Version>
+                                                       <Bundle-Version>${project.version}-r${maven.build.timestamp}</Bundle-Version>
                                                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                                                        <Bundle-RequiredExecutionEnvironment>JavaSE-11,JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
                                                        <_removeheaders>Bnd-LastModified,Build-Jdk,Built-By,Tool,Created-By</_removeheaders>
                                                        <Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
                                                        <SLC-Category>${project.groupId}</SLC-Category>
-                                                       <!-- Git metadata -->
-                                                       <!-- <SLC-Git-Commit-Id>${git.commit.id}</SLC-Git-Commit-Id> -->
-                                                       <!-- <SLC-Git-Commit-Describe>${git.commit.id.describe}</SLC-Git-Commit-Describe> -->
-                                                       <!-- <SLC-Git-Commit-Count>${git.closest.tag.commit.count}</SLC-Git-Commit-Count> -->
+                                                       <SLC-Build-Timestamp>${maven.build.timestamp}</SLC-Build-Timestamp>
                                                </instructions>
                                        </configuration>
-                                       <executions>
-                                               <execution>
-                                                       <id>bundle-manifest</id>
-                                                       <phase>process-classes</phase>
-                                                       <goals>
-                                                               <goal>manifest</goal>
-                                                       </goals>
-                                               </execution>
-                                       </executions>
                                </plugin>
                                <!-- Codehaus -->
                                <plugin>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>rpm-maven-plugin</artifactId>
-                                       <version>2.1.4</version>
+                                       <version>2.2.0</version>
                                        <extensions>true</extensions>
                                        <configuration>
                                                <version>${project.version}</version>
@@ -297,32 +283,6 @@ limitations under the License.
                        </plugins>
                </pluginManagement>
                <plugins>
-                       <plugin>
-                               <artifactId>maven-clean-plugin</artifactId>
-                               <configuration>
-                                       <filesets>
-                                               <fileset>
-                                                       <directory>META-INF</directory>
-                                                       <includes>
-                                                               <include>MANIFEST.MF</include>
-                                                       </includes>
-                                               </fileset>
-                                       </filesets>
-                               </configuration>
-                       </plugin>
-                       <!-- <plugin> -->
-                       <!-- <groupId>pl.project13.maven</groupId> -->
-                       <!-- <artifactId>git-commit-id-plugin</artifactId> -->
-                       <!-- <executions> -->
-                       <!-- <execution> -->
-                       <!-- <id>get-the-git-infos</id> -->
-                       <!-- <goals> -->
-                       <!-- <goal>revision</goal> -->
-                       <!-- </goals> -->
-                       <!-- <phase>initialize</phase> -->
-                       <!-- </execution> -->
-                       <!-- </executions> -->
-                       <!-- </plugin> -->
                        <plugin>
                                <artifactId>maven-resources-plugin</artifactId>
                                <configuration>
@@ -349,6 +309,21 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
+                       <!-- MANIFEST generation by BND -->
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>bundle-manifest</id>
+                                               <phase>process-classes</phase>
+                                               <goals>
+                                                       <goal>manifest</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- Releases -->
                        <plugin>
                                <artifactId>maven-release-plugin</artifactId>
                                <configuration>
@@ -356,10 +331,6 @@ limitations under the License.
                                        <releaseProfiles>rpmbuild</releaseProfiles>
                                </configuration>
                        </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                       </plugin>
                </plugins>
        </build>
        <dependencies>
@@ -553,8 +524,10 @@ limitations under the License.
                                                                </goals>
                                                                <configuration>
                                                                        <target>
-                                                                               <copy todir="${argeo.rpm.stagingRepository}" quiet="true" failonerror="false">
-                                                                                       <fileset dir="${project.build.directory}/rpm" includes="*/RPMS/**/*.rpm" />
+                                                                               <copy todir="${argeo.rpm.stagingRepository}" quiet="true"
+                                                                                       failonerror="false">
+                                                                                       <fileset dir="${project.build.directory}/rpm"
+                                                                                               includes="*/RPMS/**/*.rpm" />
                                                                                        <flattenmapper />
                                                                                </copy>
                                                                        </target>
@@ -579,8 +552,10 @@ limitations under the License.
                                                                </goals>
                                                                <configuration>
                                                                        <target>
-                                                                               <copy todir="${argeo.rpm.stagingRepository}" quiet="true" failonerror="false">
-                                                                                       <fileset dir="${project.build.directory}/rpm" includes="*/RPMS/**/*.rpm" />
+                                                                               <copy todir="${argeo.rpm.stagingRepository}" quiet="true"
+                                                                                       failonerror="false">
+                                                                                       <fileset dir="${project.build.directory}/rpm"
+                                                                                               includes="*/RPMS/**/*.rpm" />
                                                                                        <flattenmapper />
                                                                                </copy>
                                                                        </target>