Kaynağa Gözat

Packaged src files in pwm jar, and created zip output file.

In WEB-INF/lib/pwm-1.8.0-SNAPSHOT.jar, the project's sources are added to the /src folder during the build.  Also, when run with the "release" profile, a zip file is created containing the war file, along with the supplemental directory.
James Albright 9 yıl önce
ebeveyn
işleme
fb056d83dd
2 değiştirilmiş dosya ile 72 ekleme ve 0 silme
  1. 55 0
      pom.xml
  2. 17 0
      src/assembly/pwm.xml

+ 55 - 0
pom.xml

@@ -32,6 +32,41 @@
                 <javadoc.opts>-Xdoclint:none</javadoc.opts>
                 <javadoc.opts>-Xdoclint:none</javadoc.opts>
             </properties>
             </properties>
         </profile>
         </profile>
+        <profile>
+            <!-- Builds a zip file containing the built war file, along with the supplemental directory -->
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <version>2.6</version>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/assembly/pwm.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>make-assembly</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <!-- Disables source and javadoc jar file creation.  Handy when wanting to run quick development builds -->
+            <id>developer</id>
+            <properties>
+                <maven.javadoc.skip>true</maven.javadoc.skip>
+                <source.skip>true</source.skip>
+            </properties>
+        </profile>
     </profiles>
     </profiles>
 
 
     <build>
     <build>
@@ -112,6 +147,26 @@
                     <archiveClasses>true</archiveClasses>
                     <archiveClasses>true</archiveClasses>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.7</version>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.outputDirectory}/src</outputDirectory>
+                            <resources>
+                                <resource><directory>src/main/java</directory></resource>
+                                <resource><directory>src/main/resources</directory></resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+          </plugin>
         </plugins>
         </plugins>
     </build>
     </build>
 
 

+ 17 - 0
src/assembly/pwm.xml

@@ -0,0 +1,17 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+
+    <id>pwm-assembly</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <includes>
+                <include>supplemental/**</include>
+                <include>target/*.war</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+</assembly>