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/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 ++++++ 5 files changed, 258 insertions(+) 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 (limited to 'demo/plugins') 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 + + + -- cgit v1.2.3