]> source.dussan.org Git - archiva.git/commitdiff
prevent build order issues
authorBrett Porter <brett@apache.org>
Tue, 1 Jul 2014 04:21:52 +0000 (14:21 +1000)
committerBrett Porter <brett@apache.org>
Tue, 1 Jul 2014 04:21:52 +0000 (14:21 +1000)
It seemed that whenever the release profile was enabled, the POM ordering was
not respected causing the antrun plugin to happen before the appassembler
plugin. Move them to different, more appropriate phases.

archiva-jetty/pom.xml

index 05d9373341796056ad7189c3e155ab17853736af..da99760888bdb6c98fdad6c91fd9a20e8e7aa436 100644 (file)
               <goal>generate-daemons</goal>
               <goal>create-repository</goal>
             </goals>
-            <phase>prepare-package</phase>
+            <phase>generate-resources</phase>
           </execution>
         </executions>
       </plugin>
           </execution>
           <execution>
             <id>fix-appassembler-bug</id>
-            <phase>prepare-package</phase>
+            <phase>process-resources</phase>
             <configuration>
               <tasks>
                 <replaceregexp file="target/generated-resources/appassembler/jsw/archiva/conf/wrapper.conf" match="set.ARCHIVA_BASE" replace="set.default.ARCHIVA_BASE" />
           </supplementalModels>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-beanshell</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <phase>package</phase>
+            <configuration>
+              <rules>
+                <evaluateBeanshell>
+                  <message>wrapper.conf should be correctly set</message>
+                  <condition>
+                    <![CDATA[
+                      java.util.Properties props = new java.util.Properties();
+                      props.load( new java.io.FileInputStream( "${project.build.directory}/generated-resources/appassembler/jsw/archiva/conf/wrapper.conf" ) );
+                      props.getProperty( "set.default.ARCHIVA_BASE" ).equals( "." )
+                    ]]>
+                  </condition>
+                </evaluateBeanshell>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>