From 00acfeba25fd413c7510ba882a3a24d4c2a0b2af Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 25 Sep 2013 16:56:52 +0300 Subject: [PATCH] add missing files after refactoring plugins location --- demo/plugins/plugin1/plugin.properties | 5 + demo/plugins/plugin1/pom.xml | 131 ++++++++++++++++++ .../plugin1/src/main/assembly/assembly.xml | 37 +++++ .../pf4j/demo/welcome/WelcomePlugin.java | 46 ++++++ 4 files changed, 219 insertions(+) create mode 100644 demo/plugins/plugin1/plugin.properties create mode 100644 demo/plugins/plugin1/pom.xml create mode 100644 demo/plugins/plugin1/src/main/assembly/assembly.xml create mode 100644 demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java diff --git a/demo/plugins/plugin1/plugin.properties b/demo/plugins/plugin1/plugin.properties new file mode 100644 index 0000000..4f95d99 --- /dev/null +++ b/demo/plugins/plugin1/plugin.properties @@ -0,0 +1,5 @@ +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/plugins/plugin1/pom.xml b/demo/plugins/plugin1/pom.xml new file mode 100644 index 0000000..5880fb9 --- /dev/null +++ b/demo/plugins/plugin1/pom.xml @@ -0,0 +1,131 @@ + + + + + ro.fortsoft.pf4j.demo + pf4j-demo-plugins + 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/plugins/plugin1/src/main/assembly/assembly.xml b/demo/plugins/plugin1/src/main/assembly/assembly.xml new file mode 100644 index 0000000..3fdc464 --- /dev/null +++ b/demo/plugins/plugin1/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/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java new file mode 100644 index 0000000..d10d3dd --- /dev/null +++ b/demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java @@ -0,0 +1,46 @@ +/* + * 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"; + } + + } + +} -- 2.39.5