From 5cb10a465ebf83e44c6f5009d5e59a66327a154e Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 25 Sep 2013 16:50:37 +0300 Subject: [PATCH] put all demo plugins in folder demo/plugins --- demo/plugin1/plugin.properties | 5 - demo/plugin1/pom.xml | 131 ------------------ demo/plugin1/src/main/assembly/assembly.xml | 37 ----- .../pf4j/demo/welcome/WelcomePlugin.java | 46 ------ demo/{ => plugins}/plugin2/plugin.properties | 0 demo/{ => plugins}/plugin2/pom.xml | 2 +- .../plugin2/src/main/assembly/assembly.xml | 0 .../fortsoft/pf4j/demo/hello/HelloPlugin.java | 0 demo/plugins/pom.xml | 37 +++++ demo/pom.xml | 3 +- run-demo.bat | 4 +- run-demo.sh | 4 +- 12 files changed, 43 insertions(+), 226 deletions(-) delete mode 100644 demo/plugin1/plugin.properties delete mode 100644 demo/plugin1/pom.xml delete mode 100644 demo/plugin1/src/main/assembly/assembly.xml delete mode 100644 demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java rename demo/{ => plugins}/plugin2/plugin.properties (100%) rename demo/{ => plugins}/plugin2/pom.xml (98%) rename demo/{ => plugins}/plugin2/src/main/assembly/assembly.xml (100%) rename demo/{ => plugins}/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java (100%) create mode 100644 demo/plugins/pom.xml diff --git a/demo/plugin1/plugin.properties b/demo/plugin1/plugin.properties deleted file mode 100644 index 4f95d99..0000000 --- a/demo/plugin1/plugin.properties +++ /dev/null @@ -1,5 +0,0 @@ -plugin.id=welcome-plugin -plugin.class=ro.fortsoft.pf4j.demo.welcome.WelcomePlugin -plugin.version=0.0.1 -plugin.provider=Decebal Suiu -plugin.dependencies= diff --git a/demo/plugin1/pom.xml b/demo/plugin1/pom.xml deleted file mode 100644 index 49cf1df..0000000 --- a/demo/plugin1/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - ro.fortsoft.pf4j.demo - pf4j-demo-parent - 0.5-SNAPSHOT - - - 4.0.0 - pf4j-demo-plugin1 - 0.5-SNAPSHOT - jar - Demo Plugin #1 - - - welcome-plugin - ro.fortsoft.pf4j.demo.welcome.WelcomePlugin - 0.0.1 - Decebal Suiu - - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.6 - - - unzip jar file - package - - - - - - - run - - - - - - - maven-assembly-plugin - 2.3 - - - - src/main/assembly/assembly.xml - - - false - - - - make-assembly - package - - attached - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - ${plugin.id} - ${plugin.class} - ${plugin.version} - ${plugin.provider} - ${plugin.dependencies} - - - - - - - maven-deploy-plugin - - true - - - - - - - - ro.fortsoft.pf4j - pf4j - ${project.version} - provided - - - - ro.fortsoft.pf4j.demo - pf4j-demo-api - ${project.version} - provided - - - - diff --git a/demo/plugin1/src/main/assembly/assembly.xml b/demo/plugin1/src/main/assembly/assembly.xml deleted file mode 100644 index 3fdc464..0000000 --- a/demo/plugin1/src/main/assembly/assembly.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - plugin - - zip - - false - - - false - runtime - lib - - *:jar:* - - - - - - - target/plugin-classes - classes - - - diff --git a/demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java deleted file mode 100644 index d10d3dd..0000000 --- a/demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012 Decebal Suiu - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with - * the License. You may obtain a copy of the License in the LICENSE file, or at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package ro.fortsoft.pf4j.demo.welcome; - -import ro.fortsoft.pf4j.Extension; -import ro.fortsoft.pf4j.Plugin; -import ro.fortsoft.pf4j.PluginWrapper; -import ro.fortsoft.pf4j.demo.api.Greeting; - -/** - * @author Decebal Suiu - */ -public class WelcomePlugin extends Plugin { - - public WelcomePlugin(PluginWrapper wrapper) { - super(wrapper); - } - - public void start() { - System.out.println("WelcomePlugin.start()"); - } - - public void stop() { - System.out.println("WelcomePlugin.stop()"); - } - - @Extension - public static class WelcomeGreeting implements Greeting { - - public String getGreeting() { - return "Welcome"; - } - - } - -} diff --git a/demo/plugin2/plugin.properties b/demo/plugins/plugin2/plugin.properties similarity index 100% rename from demo/plugin2/plugin.properties rename to demo/plugins/plugin2/plugin.properties diff --git a/demo/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml similarity index 98% rename from demo/plugin2/pom.xml rename to demo/plugins/plugin2/pom.xml index b69f767..62d99fe 100644 --- a/demo/plugin2/pom.xml +++ b/demo/plugins/plugin2/pom.xml @@ -3,7 +3,7 @@ ro.fortsoft.pf4j.demo - pf4j-demo-parent + pf4j-demo-plugins 0.5-SNAPSHOT diff --git a/demo/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml similarity index 100% rename from demo/plugin2/src/main/assembly/assembly.xml rename to demo/plugins/plugin2/src/main/assembly/assembly.xml diff --git a/demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java b/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java similarity index 100% rename from demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java rename to demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java diff --git a/demo/plugins/pom.xml b/demo/plugins/pom.xml new file mode 100644 index 0000000..9420816 --- /dev/null +++ b/demo/plugins/pom.xml @@ -0,0 +1,37 @@ + + + + + ro.fortsoft.pf4j.demo + pf4j-demo-parent + 0.5-SNAPSHOT + + + 4.0.0 + ro.fortsoft.pf4j.demo + pf4j-demo-plugins + 0.5-SNAPSHOT + pom + Demo Plugins Parent + + + + + false + src/main/java + + **/*.java + + + + src/main/resources + + + + + + plugin1 + plugin2 + + + diff --git a/demo/pom.xml b/demo/pom.xml index 76bd4d7..2c7f277 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -32,8 +32,7 @@ app api - plugin1 - plugin2 + plugins diff --git a/run-demo.bat b/run-demo.bat index 05c53df..0edca59 100644 --- a/run-demo.bat +++ b/run-demo.bat @@ -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\plugin1\target\pf4j-demo-plugin1-*.zip demo-dist\plugins /s -xcopy demo\plugin2\target\pf4j-demo-plugin2-*.zip demo-dist\plugins /s +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 cd demo-dist diff --git a/run-demo.sh b/run-demo.sh index ce68e5b..724d68b 100755 --- a/run-demo.sh +++ b/run-demo.sh @@ -14,8 +14,8 @@ mkdir demo-dist/plugins # copy artifacts to demo-dist folder cp -r demo/app/target/pf4j-demo-*/* demo-dist/ -cp demo/plugin1/target/pf4j-demo-plugin1-*.zip demo-dist/plugins/ -cp demo/plugin2/target/pf4j-demo-plugin2-*.zip demo-dist/plugins/ +cp demo/plugins/plugin1/target/pf4j-demo-plugin1-*.zip demo-dist/plugins/ +cp demo/plugins/plugin2/target/pf4j-demo-plugin2-*.zip demo-dist/plugins/ # run demo cd demo-dist -- 2.39.5