Improve RPM build
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 13 Feb 2012 13:15:04 +0000 (13:15 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 13 Feb 2012 13:15:04 +0000 (13:15 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5068 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

dep/org.argeo.slc.dep.backend/pom.xml
dep/org.argeo.slc.dep.rap/pom.xml
dep/org.argeo.slc.dep.rcp/pom.xml
dist/pom.xml
dist/slc-maven/pom.xml
dist/slc-maven/src/main/rpm/var/lib/slc/.m2/settings.xml [deleted file]
dist/slc-maven/src/main/scripts/preremove [deleted file]
dist/slc/pom.xml
dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml [new file with mode: 0644]
dist/slc/src/main/scripts/preremove-5
dist/slc/src/main/scripts/preremove-6

index 6aaa71d47726631b1dca485838db12661bfed793..3c46f14cd57b00bccb5853c59a1c0315c551f2ad 100644 (file)
                                                        </execution>
                                                </executions>
                                        </plugin>
-                                       <plugin>
-                                               <artifactId>maven-antrun-plugin</artifactId>
-                                               <executions>
-                                                       <execution>
-                                                               <phase>install</phase>
-                                                               <goals>
-                                                                       <goal>run</goal>
-                                                               </goals>
-                                                               <configuration>
-                                                                       <target>
-                                                                               <copy todir="${rpm.stagingRepository}" verbose="true">
-                                                                                       <fileset dir="${project.build.directory}/rpm"
-                                                                                               includes="*/RPMS/**/*.rpm" />
-                                                                                       <flattenmapper />
-                                                                               </copy>
-                                                                       </target>
-                                                               </configuration>
-                                                       </execution>
-                                               </executions>
-                                       </plugin>
                                </plugins>
                        </build>
                </profile>
                                                                                        </dependency>
                                                                                </mapping>
                                                                        </mappings>
+                                                                       <requires>
+                                                                               <require>argeo-node-tp</require>
+                                                                       </requires>
                                                                </configuration>
                                                        </execution>
                                                </executions>
index 6a43fdbd5f11ece1fdace5b5d3af166b68012876..0b23f2c5ba69d6f2b0aed55cf8f1b699b5d9d60c 100644 (file)
                                <groupId>org.argeo.maven.plugins</groupId>
                                <artifactId>maven-argeo-osgi-plugin</artifactId>
                                <executions>
-                                       <execution>
-                                               <id>resolve-pde-sources</id>
-                                               <goals>
-                                                       <goal>pde-sources</goal>
-                                               </goals>
-                                               <phase>generate-resources</phase>
-                                               <configuration>
-                                                       <copyArtifacts>false</copyArtifacts>
-                                               </configuration>
-                                       </execution>
                                        <execution>
                                                <id>generate-descriptors</id>
                                                <goals>
                                </plugins>
                        </build>
                </profile>
+               <profile>
+                       <id>pdeSources</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.argeo.maven.plugins</groupId>
+                                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                                               <executions>
+                                                       <execution>
+                                                               <id>resolve-pde-sources</id>
+                                                               <goals>
+                                                                       <goal>pde-sources</goal>
+                                                               </goals>
+                                                               <phase>generate-resources</phase>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
        </profiles>
 </project>
\ No newline at end of file
index 4bbd58c1f1480d7ec9d0cfce51899fb2f5efaa4d..8705de43f68110c3030db9c14deae8e733c8479a 100644 (file)
                                </plugins>
                        </build>
                </profile>
+               <profile>
+                       <id>pdeSources</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.argeo.maven.plugins</groupId>
+                                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                                               <executions>
+                                                       <execution>
+                                                               <id>resolve-pde-sources</id>
+                                                               <goals>
+                                                                       <goal>pde-sources</goal>
+                                                               </goals>
+                                                               <phase>generate-resources</phase>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
        </profiles>
 </project>
\ No newline at end of file
index f8e3950223b32dc0da97d82e097dd7312820dc38..2f563158702624a8caa3ae189dcb1091873f7773 100644 (file)
@@ -30,7 +30,8 @@
                                                                </goals>
                                                                <configuration>
                                                                        <target>
-                                                                               <copy todir="${rpm.stagingRepository}" verbose="true">
+                                                                               <copy todir="${rpm.stagingRepository}" verbose="true"
+                                                                                       failonerror="false">
                                                                                        <fileset dir="${project.build.directory}/rpm"
                                                                                                includes="*/RPMS/**/*.rpm" />
                                                                                        <flattenmapper />
index b12644bb5ca8850e3adcf9e864e391626d35ac2f..42d7d13acee2359f7e59751f1f3e94a3ccfd73e9 100644 (file)
                                                                                                </includes>
                                                                                        </dependency>
                                                                                </mapping>
-                                                                               <mapping>
-                                                                                       <directory>/var/lib/slc/.m2</directory>
-                                                                                       <username>slc</username>
-                                                                                       <groupname>slc</groupname>
-                                                                                       <filemode>644</filemode>
-                                                                                       <directoryIncluded>false</directoryIncluded>
-                                                                                       <sources>
-                                                                                               <source>
-                                                                                                       <location>src/main/var/lib/slc/.m2</location>
-                                                                                               </source>
-                                                                                       </sources>
-                                                                               </mapping>
                                                                        </mappings>
-                                                                       <preremoveScriptlet>
-                                                                               <scriptFile>src/main/scripts/preremove</scriptFile>
-                                                                       </preremoveScriptlet>
                                                                        <requires>
-                                                                               <require>slc</require>
+                                                                               <require>slc-libs</require>
                                                                        </requires>
                                                                </configuration>
                                                        </execution>
diff --git a/dist/slc-maven/src/main/rpm/var/lib/slc/.m2/settings.xml b/dist/slc-maven/src/main/rpm/var/lib/slc/.m2/settings.xml
deleted file mode 100644 (file)
index 3957593..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<settings 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/settings-1.0.0.xsd">
-       <mirrors>
-               <mirror>
-                       <id>slc-repo</id>
-                       <name>SLC Repository</name>
-                       <url>http://localhost:7080/org.argeo.slc.repo.webapp/maven</url>
-                       <mirrorOf>*</mirrorOf>
-               </mirror>
-       </mirrors>
-       <servers>
-               <server>
-                       <id>slc-repo</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-               <server>
-                       <id>localrepo</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-               <server>
-                       <id>localrepo.snapshots</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-       </servers>
-</settings>
-
diff --git a/dist/slc-maven/src/main/scripts/preremove b/dist/slc-maven/src/main/scripts/preremove
deleted file mode 100644 (file)
index cbeb211..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-if [ $1 = "0" ];then
-       APP=slc
-       rm -rf /var/lib/$APP/.m2/repository
-fi
index bf7ea8ce054371d5574bc92f37181137e872400e..3e79303d251aa460a07c2cb1c3eef696c4fccbb9 100644 (file)
        <artifactId>slc</artifactId>
        <packaging>pom</packaging>
        <name>SLC Node (RPM)</name>
-       <build>
-               <plugins>
-                       <plugin>
-                               <artifactId>maven-resources-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>filter-base</id>
-                                               <phase>process-resources</phase>
-                                               <goals>
-                                                       <goal>copy-resources</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <outputDirectory>${basedir}/target/base</outputDirectory>
-                                                       <resources>
-                                                               <resource>
-                                                                       <directory>src/main/base</directory>
-                                                                       <filtering>true</filtering>
-                                                               </resource>
-                                                       </resources>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
+<!--   <build> -->
+<!--           <plugins> -->
+<!--                   <plugin> -->
+<!--                           <artifactId>maven-resources-plugin</artifactId> -->
+<!--                           <executions> -->
+<!--                                   <execution> -->
+<!--                                           <id>filter-base</id> -->
+<!--                                           <phase>process-resources</phase> -->
+<!--                                           <goals> -->
+<!--                                                   <goal>copy-resources</goal> -->
+<!--                                           </goals> -->
+<!--                                           <configuration> -->
+<!--                                                   <outputDirectory>${basedir}/target/base</outputDirectory> -->
+<!--                                                   <resources> -->
+<!--                                                           <resource> -->
+<!--                                                                   <directory>src/main/base</directory> -->
+<!--                                                                   <filtering>true</filtering> -->
+<!--                                                           </resource> -->
+<!--                                                   </resources> -->
+<!--                                           </configuration> -->
+<!--                                   </execution> -->
+<!--                           </executions> -->
+<!--                   </plugin> -->
+<!--           </plugins> -->
+<!--   </build> -->
        <profiles>
                <profile>
                        <id>rpmbuild</id>
                                                                                                </source>
                                                                                        </sources>
                                                                                </mapping>
+                                                                               <!-- Maven (even if not installed) -->
+                                                                               <mapping>
+                                                                                       <directory>/var/lib/slc/.m2</directory>
+                                                                                       <username>slc</username>
+                                                                                       <groupname>slc</groupname>
+                                                                                       <filemode>600</filemode>
+                                                                                       <directoryIncluded>false</directoryIncluded>
+                                                                                       <sources>
+                                                                                               <source>
+                                                                                                       <location>src/main/rpm/var/lib/slc/.m2</location>
+                                                                                               </source>
+                                                                                       </sources>
+                                                                               </mapping>
                                                                        </mappings>
                                                                        <preinstallScriptlet>
                                                                                <scriptFile>src/main/scripts/preinstall-${rpm.release}</scriptFile>
                                                        </execution>
                                                </executions>
                                        </plugin>
-                                       <plugin>
-                                               <artifactId>maven-antrun-plugin</artifactId>
-                                               <executions>
-                                                       <execution>
-                                                               <phase>install</phase>
-                                                               <goals>
-                                                                       <goal>run</goal>
-                                                               </goals>
-                                                               <configuration>
-                                                                       <target>
-                                                                               <copy todir="${rpm.stagingRepository}" verbose="true">
-                                                                                       <fileset dir="${project.build.directory}/rpm"
-                                                                                               includes="*/RPMS/**/*.rpm" />
-                                                                                       <flattenmapper />
-                                                                               </copy>
-                                                                       </target>
-                                                               </configuration>
-                                                       </execution>
-                                               </executions>
-                                       </plugin>
                                </plugins>
                        </build>
                </profile>
diff --git a/dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml b/dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml
new file mode 100644 (file)
index 0000000..3957593
--- /dev/null
@@ -0,0 +1,30 @@
+<settings 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/settings-1.0.0.xsd">
+       <mirrors>
+               <mirror>
+                       <id>slc-repo</id>
+                       <name>SLC Repository</name>
+                       <url>http://localhost:7080/org.argeo.slc.repo.webapp/maven</url>
+                       <mirrorOf>*</mirrorOf>
+               </mirror>
+       </mirrors>
+       <servers>
+               <server>
+                       <id>slc-repo</id>
+                       <username>root</username>
+                       <password>demo</password>
+               </server>
+               <server>
+                       <id>localrepo</id>
+                       <username>root</username>
+                       <password>demo</password>
+               </server>
+               <server>
+                       <id>localrepo.snapshots</id>
+                       <username>root</username>
+                       <password>demo</password>
+               </server>
+       </servers>
+</settings>
+
index e5532dbc5937b378416e95d3f7274c3608ed039a..b842b9cb9068d4a3966feddf485447b16bbbe6ba 100644 (file)
@@ -2,5 +2,9 @@ if [ $1 = "0" ];then
        #APP=%{name} => doesn't work
        APP=slc
        /sbin/chkconfig --del $APP
+       
+       # Maven
+       rm -rf /var/lib/$APP/.m2/repository
+       
        #userdel $APP
 fi
index e5532dbc5937b378416e95d3f7274c3608ed039a..b79d26175a2543ae23a2b0c16143c10716880520 100644 (file)
@@ -2,5 +2,9 @@ if [ $1 = "0" ];then
        #APP=%{name} => doesn't work
        APP=slc
        /sbin/chkconfig --del $APP
+
+       # Maven
+       rm -rf /var/lib/$APP/.m2/repository
+
        #userdel $APP
 fi