From 5cb10a465ebf83e44c6f5009d5e59a66327a154e Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 25 Sep 2013 16:50:37 +0300 Subject: 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 ------ .../fortsoft/pf4j/demo/welcome/WelcomePlugin.java | 46 -------- demo/plugin2/plugin.properties | 5 - demo/plugin2/pom.xml | 131 --------------------- demo/plugin2/src/main/assembly/assembly.xml | 37 ------ .../ro/fortsoft/pf4j/demo/hello/HelloPlugin.java | 48 -------- demo/plugins/plugin2/plugin.properties | 5 + demo/plugins/plugin2/pom.xml | 131 +++++++++++++++++++++ .../plugins/plugin2/src/main/assembly/assembly.xml | 37 ++++++ .../ro/fortsoft/pf4j/demo/hello/HelloPlugin.java | 48 ++++++++ demo/plugins/pom.xml | 37 ++++++ demo/pom.xml | 3 +- run-demo.bat | 4 +- run-demo.sh | 4 +- 16 files changed, 263 insertions(+), 446 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 delete mode 100644 demo/plugin2/plugin.properties delete mode 100644 demo/plugin2/pom.xml delete mode 100644 demo/plugin2/src/main/assembly/assembly.xml delete mode 100644 demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java create mode 100644 demo/plugins/plugin2/plugin.properties create mode 100644 demo/plugins/plugin2/pom.xml create mode 100644 demo/plugins/plugin2/src/main/assembly/assembly.xml create mode 100644 demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java 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/plugin2/plugin.properties deleted file mode 100644 index 0de45e6..0000000 --- a/demo/plugin2/plugin.properties +++ /dev/null @@ -1,5 +0,0 @@ -plugin.id=hello-plugin -plugin.class=ro.fortsoft.pf4j.demo.hello.HelloPlugin -plugin.version=0.0.1 -plugin.provider=Decebal Suiu -plugin.dependencies= diff --git a/demo/plugin2/pom.xml b/demo/plugin2/pom.xml deleted file mode 100644 index b69f767..0000000 --- a/demo/plugin2/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - ro.fortsoft.pf4j.demo - pf4j-demo-parent - 0.5-SNAPSHOT - - - 4.0.0 - pf4j-demo-plugin2 - 0.5-SNAPSHOT - jar - Demo Plugin #2 - - - hello-plugin - ro.fortsoft.pf4j.demo.hello.HelloPlugin - 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/plugin2/src/main/assembly/assembly.xml b/demo/plugin2/src/main/assembly/assembly.xml deleted file mode 100644 index 5cefe0d..0000000 --- a/demo/plugin2/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/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java b/demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java deleted file mode 100644 index 8f12e23..0000000 --- a/demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java +++ /dev/null @@ -1,48 +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.hello; - -import ro.fortsoft.pf4j.Extension; -import ro.fortsoft.pf4j.Plugin; -import ro.fortsoft.pf4j.PluginWrapper; -import ro.fortsoft.pf4j.demo.api.Greeting; - -/** - * A very simple plugin. - * - * @author Decebal Suiu - */ -public class HelloPlugin extends Plugin { - - public HelloPlugin(PluginWrapper wrapper) { - super(wrapper); - } - - public void start() { - System.out.println("HelloPlugin.start()"); - } - - public void stop() { - System.out.println("HelloPlugin.stop()"); - } - - @Extension - public static class HelloGreeting implements Greeting { - - public String getGreeting() { - return "Hello"; - } - - } - -} diff --git a/demo/plugins/plugin2/plugin.properties b/demo/plugins/plugin2/plugin.properties new file mode 100644 index 0000000..0de45e6 --- /dev/null +++ b/demo/plugins/plugin2/plugin.properties @@ -0,0 +1,5 @@ +plugin.id=hello-plugin +plugin.class=ro.fortsoft.pf4j.demo.hello.HelloPlugin +plugin.version=0.0.1 +plugin.provider=Decebal Suiu +plugin.dependencies= diff --git a/demo/plugins/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml new file mode 100644 index 0000000..62d99fe --- /dev/null +++ b/demo/plugins/plugin2/pom.xml @@ -0,0 +1,131 @@ + + + + + ro.fortsoft.pf4j.demo + pf4j-demo-plugins + 0.5-SNAPSHOT + + + 4.0.0 + pf4j-demo-plugin2 + 0.5-SNAPSHOT + jar + Demo Plugin #2 + + + hello-plugin + ro.fortsoft.pf4j.demo.hello.HelloPlugin + 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/plugins/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml new file mode 100644 index 0000000..5cefe0d --- /dev/null +++ b/demo/plugins/plugin2/src/main/assembly/assembly.xml @@ -0,0 +1,37 @@ + + + plugin + + zip + + false + + + false + runtime + lib + + *:jar:* + + + + + + + target/plugin-classes + classes + + + diff --git a/demo/plugins/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 new file mode 100644 index 0000000..8f12e23 --- /dev/null +++ b/demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java @@ -0,0 +1,48 @@ +/* + * 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.hello; + +import ro.fortsoft.pf4j.Extension; +import ro.fortsoft.pf4j.Plugin; +import ro.fortsoft.pf4j.PluginWrapper; +import ro.fortsoft.pf4j.demo.api.Greeting; + +/** + * A very simple plugin. + * + * @author Decebal Suiu + */ +public class HelloPlugin extends Plugin { + + public HelloPlugin(PluginWrapper wrapper) { + super(wrapper); + } + + public void start() { + System.out.println("HelloPlugin.start()"); + } + + public void stop() { + System.out.println("HelloPlugin.stop()"); + } + + @Extension + public static class HelloGreeting implements Greeting { + + public String getGreeting() { + return "Hello"; + } + + } + +} 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 -- cgit v1.2.3