diff options
author | Tyler Hawkes <tylerhawkes@users.noreply.github.com> | 2018-01-18 03:55:27 -0700 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2018-01-18 12:55:27 +0200 |
commit | 77801cc19de4d800089b164e447b571ad8c75034 (patch) | |
tree | 42722889ec97bceb6fcf8582b0f424d2bb12d564 | |
parent | 44acc380810180593c8c6e85f80f5274d71540a2 (diff) | |
download | pf4j-77801cc19de4d800089b164e447b571ad8c75034.tar.gz pf4j-77801cc19de4d800089b164e447b571ad8c75034.zip |
Changing packaging (#194)
-rw-r--r-- | demo/plugins/plugin1/pom.xml | 91 | ||||
-rw-r--r-- | demo/plugins/plugin1/src/main/assembly/assembly.xml | 37 | ||||
-rw-r--r-- | demo/plugins/plugin2/pom.xml | 91 | ||||
-rw-r--r-- | demo/plugins/plugin2/src/main/assembly/assembly.xml | 37 | ||||
-rw-r--r-- | demo/plugins/pom.xml | 107 | ||||
-rw-r--r-- | run-demo.bat | 6 | ||||
-rwxr-xr-x | run-demo.sh | 8 |
7 files changed, 61 insertions, 316 deletions
diff --git a/demo/plugins/plugin1/pom.xml b/demo/plugins/plugin1/pom.xml index 90d5b71..8c2f826 100644 --- a/demo/plugins/plugin1/pom.xml +++ b/demo/plugins/plugin1/pom.xml @@ -21,97 +21,6 @@ <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 index ce2e92c..0000000 --- a/demo/plugins/plugin1/src/main/assembly/assembly.xml +++ /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> diff --git a/demo/plugins/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml index 9a844fd..fb2d223 100644 --- a/demo/plugins/plugin2/pom.xml +++ b/demo/plugins/plugin2/pom.xml @@ -21,95 +21,4 @@ <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 index 4eacbe3..0000000 --- a/demo/plugins/plugin2/src/main/assembly/assembly.xml +++ /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> diff --git a/demo/plugins/pom.xml b/demo/plugins/pom.xml index 5e61dbf..682ccfd 100644 --- a/demo/plugins/pom.xml +++ b/demo/plugins/pom.xml @@ -13,69 +13,72 @@ <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> diff --git a/run-demo.bat b/run-demo.bat index 0edca59..445e410 100644 --- a/run-demo.bat +++ b/run-demo.bat @@ -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 diff --git a/run-demo.sh b/run-demo.sh index 724d68b..b8c5220 100755 --- a/run-demo.sh +++ b/run-demo.sh @@ -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 |