瀏覽代碼

Merge pull request #4 from pwm-project/packaging-changes

Packaging changes
Jason 9 年之前
父節點
當前提交
13b5f1b57d
共有 3 個文件被更改,包括 81 次插入0 次删除
  1. 1 0
      .gitignore
  2. 63 0
      pom.xml
  3. 17 0
      src/assembly/pwm.xml

+ 1 - 0
.gitignore

@@ -9,3 +9,4 @@
 /src/main/webapp/WEB-INF/backup
 /src/main/webapp/WEB-INF/LocalDB
 /bin/
+/src/main/webapp/WEB-INF/applicationPath.lock

+ 63 - 0
pom.xml

@@ -32,6 +32,41 @@
                 <javadoc.opts>-Xdoclint:none</javadoc.opts>
             </properties>
         </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>
 
     <build>
@@ -104,6 +139,34 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.6</version>
+                <configuration>
+                    <archiveClasses>true</archiveClasses>
+                </configuration>
+            </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>
     </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>