]> source.dussan.org Git - pf4j.git/commitdiff
Changing packaging (#194)
authorTyler Hawkes <tylerhawkes@users.noreply.github.com>
Thu, 18 Jan 2018 10:55:27 +0000 (03:55 -0700)
committerDecebal Suiu <decebal.suiu@gmail.com>
Thu, 18 Jan 2018 10:55:27 +0000 (12:55 +0200)
demo/plugins/plugin1/pom.xml
demo/plugins/plugin1/src/main/assembly/assembly.xml [deleted file]
demo/plugins/plugin2/pom.xml
demo/plugins/plugin2/src/main/assembly/assembly.xml [deleted file]
demo/plugins/pom.xml
run-demo.bat
run-demo.sh

index 90d5b71b382d9a96d9cf8dbc4e682d311930dcdf..8c2f8267a8a2f1070b2c932c800288c152fb24b6 100644 (file)
         <plugin.dependencies />
     </properties>
 
-    <build>
-        <plugins>
-            <!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>properties-maven-plugin</artifactId>
-                <version>1.0-alpha-2</version>
-                <executions>
-                  <execution>
-                    <phase>initialize</phase>
-                    <goals>
-                      <goal>read-project-properties</goal>
-                    </goals>
-                    <configuration>
-                      <files>
-                        <file>plugin.properties</file>
-                      </files>
-                    </configuration>
-                  </execution>
-                </executions>
-            </plugin>
-            -->
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.6</version>
-                <executions>
-                    <execution>
-                        <id>unzip jar file</id>
-                        <phase>package</phase>
-                        <configuration>
-                            <target>
-                                <unzip src="target/${project.artifactId}-${project.version}.${project.packaging}" dest="target/plugin-classes" />
-                            </target>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.3</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>
-                            src/main/assembly/assembly.xml
-                        </descriptor>
-                    </descriptors>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <archive>
-                        <manifestEntries>
-                            <Plugin-Id>${plugin.id}</Plugin-Id>
-                            <Plugin-Class>${plugin.class}</Plugin-Class>
-                            <Plugin-Version>${plugin.version}</Plugin-Version>
-                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
-                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
     <dependencies>
                <dependency>
                        <groupId>commons-lang</groupId>
diff --git a/demo/plugins/plugin1/src/main/assembly/assembly.xml b/demo/plugins/plugin1/src/main/assembly/assembly.xml
deleted file mode 100644 (file)
index ce2e92c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Describes the plugin archive
-
- @author Decebal Suiu
- @version 1.0
--->
-<assembly>
-       <id>plugin</id>
-       <formats>
-               <format>zip</format>
-       </formats>
-       <includeBaseDirectory>false</includeBaseDirectory>
-       <dependencySets>
-               <dependencySet>
-            <useProjectArtifact>false</useProjectArtifact>
-            <scope>runtime</scope>
-                       <outputDirectory>lib</outputDirectory>
-                       <includes>
-                               <include>*:jar:*</include>
-                       </includes>
-               </dependencySet>
-       </dependencySets>
-    <!--
-    <fileSets>
-        <fileSet>
-            <directory>target/classes</directory>
-            <outputDirectory>classes</outputDirectory>
-        </fileSet>
-    </fileSets>
-    -->
-       <fileSets>
-               <fileSet>
-                       <directory>target/plugin-classes</directory>
-                       <outputDirectory>classes</outputDirectory>
-               </fileSet>
-       </fileSets>
-</assembly>
index 9a844fde08f3bdc5622c48d7e2ed6b1ab5aac401..fb2d223b53f1ee2f985e0a0682b196558a10c612 100644 (file)
         <plugin.dependencies />
     </properties>
 
-    <build>
-        <plugins>
-            <!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>properties-maven-plugin</artifactId>
-                <version>1.0-alpha-2</version>
-                <executions>
-                    <execution>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>read-project-properties</goal>
-                        </goals>
-                        <configuration>
-                            <files>
-                                <file>plugin.properties</file>
-                            </files>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            -->
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.6</version>
-                <executions>
-                    <execution>
-                        <id>unzip jar file</id>
-                        <phase>package</phase>
-                        <configuration>
-                            <target>
-                                <unzip src="target/${project.artifactId}-${project.version}.${project.packaging}" dest="target/plugin-classes" />
-                            </target>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.3</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>
-                            src/main/assembly/assembly.xml
-                        </descriptor>
-                    </descriptors>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <archive>
-                        <manifestEntries>
-                            <Plugin-Id>${plugin.id}</Plugin-Id>
-                            <Plugin-Class>${plugin.class}</Plugin-Class>
-                            <Plugin-Version>${plugin.version}</Plugin-Version>
-                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
-                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>
diff --git a/demo/plugins/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml
deleted file mode 100644 (file)
index 4eacbe3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Describes the plugin archive
-
- @author Decebal Suiu
- @version 1.0
--->
-<assembly>
-       <id>plugin</id>
-       <formats>
-               <format>zip</format>
-       </formats>
-       <includeBaseDirectory>false</includeBaseDirectory>
-       <dependencySets>
-               <dependencySet>
-            <useProjectArtifact>false</useProjectArtifact>
-            <scope>runtime</scope>
-                       <outputDirectory>lib</outputDirectory>
-                       <includes>
-                               <include>*:jar:*</include>
-                       </includes>
-               </dependencySet>
-       </dependencySets>
-    <!--
-       <fileSets>
-               <fileSet>
-                       <directory>target/classes</directory>
-                       <outputDirectory>classes</outputDirectory>
-               </fileSet>
-       </fileSets>
-    -->
-    <fileSets>
-        <fileSet>
-            <directory>target/plugin-classes</directory>
-            <outputDirectory>classes</outputDirectory>
-        </fileSet>
-    </fileSets>
-</assembly>
index 5e61dbfe5a6351dbdec9a0e25b5930e3042d2ccd..682ccfdd6cc09b188160a8820c7def11c7837da5 100644 (file)
     <packaging>pom</packaging>
     <name>Demo Plugins Parent</name>
 
-    <build>
-        <resources>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/java</directory>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-            </resource>
-        </resources>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.7</java.version>
+        <plugin.id />
+        <plugin.class />
+        <plugin.version />
+        <plugin.provider />
+        <plugin.dependencies />
+    </properties>
 
+    <build>
         <plugins>
             <plugin>
-                <artifactId>maven-dependency-plugin</artifactId>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.7.0</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.1.0</version>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <finalName>${project.artifactId}-${project.version}-plugin</finalName>
+                    <appendAssemblyId>false</appendAssemblyId>
+                    <attach>false</attach>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Plugin-Id>${plugin.id}</Plugin-Id>
+                            <Plugin-Version>${plugin.version}</Plugin-Version>
+                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
+                            <Plugin-Class>${plugin.class}</Plugin-Class>
+                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
                 <executions>
                     <execution>
-                        <phase>process-sources</phase>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
                         <goals>
-                            <goal>copy-dependencies</goal>
+                            <goal>single</goal>
                         </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
-                            <excludeScope>provided</excludeScope>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+                <version>2.8.2</version>
+            </plugin>
         </plugins>
-
-               <pluginManagement>
-                       <plugins>
-                               <plugin>
-                                       <groupId>org.eclipse.m2e</groupId>
-                                       <artifactId>lifecycle-mapping</artifactId>
-                                       <version>1.0.0</version>
-                                       <configuration>
-                                               <lifecycleMappingMetadata>
-                                                       <pluginExecutions>
-                                                               <pluginExecution>
-                                                                       <pluginExecutionFilter>
-                                                                               <groupId>org.apache.maven.plugins</groupId>
-                                                                               <artifactId>maven-dependency-plugin</artifactId>
-                                                                               <versionRange>[2.0,)</versionRange>
-                                                                               <goals>
-                                                                                       <goal>copy-dependencies</goal>
-                                                                               </goals>
-                                                                       </pluginExecutionFilter>
-                                                                       <action>
-                                                                               <execute>
-                                                                                       <runOnIncremental>true</runOnIncremental>
-                                                                                       <runOnConfiguration>true</runOnConfiguration>
-                                                                               </execute>
-                                                                       </action>
-                                                               </pluginExecution>
-                                                       </pluginExecutions>
-                                               </lifecycleMappingMetadata>
-                                       </configuration>
-                               </plugin>
-                       </plugins>
-               </pluginManagement>
     </build>
 
     <modules>
index 0edca593f897a105dad2a2d04344767d40008c26..445e41050b7093dc630d8bd6209967119a45910f 100644 (file)
@@ -3,7 +3,7 @@ REM This script creates and run the pf4j demo.
 REM
 
 REM create artifacts using maven
-call mvn clean package
+call mvn clean package -DskipTests
 
 REM create demo-dist folder
 rmdir demo-dist /s /q
@@ -12,8 +12,8 @@ mkdir demo-dist\plugins
 
 REM copy artifacts to demo-dist folder
 xcopy demo\app\target\pf4j-demo-app-*.zip demo-dist /s /i
-xcopy demo\plugins\plugin1\target\pf4j-demo-plugin1-*.zip demo-dist\plugins /s
-xcopy demo\plugins\plugin2\target\pf4j-demo-plugin2-*.zip demo-dist\plugins /s
+xcopy demo\plugins\plugin1\target\*plugin.jar demo-dist\plugins /s
+xcopy demo\plugins\plugin2\target\*plugin.jar demo-dist\plugins /s
 
 cd demo-dist
 
index 724d68b0a9e4afefde6a3dba6b3611d45260dc29..b8c522026bc702c0e34af84e243ea3b61aebda3d 100755 (executable)
@@ -5,17 +5,15 @@
 #
 
 # create artifacts using maven
-mvn clean package
+mvn clean package -DskipTests
 
 # create demo-dist folder
 rm -fr demo-dist
-mkdir demo-dist
-mkdir demo-dist/plugins
+mkdir -p demo-dist/plugins
 
 # copy artifacts to demo-dist folder
 cp -r demo/app/target/pf4j-demo-*/* demo-dist/
-cp demo/plugins/plugin1/target/pf4j-demo-plugin1-*.zip demo-dist/plugins/
-cp demo/plugins/plugin2/target/pf4j-demo-plugin2-*.zip demo-dist/plugins/
+cp demo/plugins/*/target/*plugin.jar demo-dist/plugins/
 
 # run demo
 cd demo-dist