From 9bd850bd57dc1df58f8103024df996d164c5ca0b Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Tue, 16 Oct 2012 14:33:48 +0300 Subject: prepare for maven central repository --- demo/api/pom.xml | 4 +- .../src/main/java/org/pf4j/demo/api/Greeting.java | 24 -------- .../java/ro/fortsoft/pf4j/demo/api/Greeting.java | 24 ++++++++ demo/app/pom.xml | 8 +-- demo/app/src/main/java/org/pf4j/demo/Boot.java | 63 --------------------- .../src/main/java/ro/fortsoft/pf4j/demo/Boot.java | 64 ++++++++++++++++++++++ demo/plugin1/plugin.properties | 2 +- demo/plugin1/pom.xml | 6 +- .../java/org/pf4j/demo/welcome/WelcomePlugin.java | 46 ---------------- .../fortsoft/pf4j/demo/welcome/WelcomePlugin.java | 46 ++++++++++++++++ demo/plugin2/plugin.properties | 2 +- demo/plugin2/pom.xml | 6 +- .../main/java/org/pf4j/demo/hello/HelloPlugin.java | 48 ---------------- .../ro/fortsoft/pf4j/demo/hello/HelloPlugin.java | 48 ++++++++++++++++ demo/pom.xml | 4 +- 15 files changed, 198 insertions(+), 197 deletions(-) delete mode 100644 demo/api/src/main/java/org/pf4j/demo/api/Greeting.java create mode 100644 demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java delete mode 100644 demo/app/src/main/java/org/pf4j/demo/Boot.java create mode 100644 demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java delete mode 100644 demo/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java create mode 100644 demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java delete mode 100644 demo/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java create mode 100644 demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java (limited to 'demo') diff --git a/demo/api/pom.xml b/demo/api/pom.xml index 1514476..59c02ff 100644 --- a/demo/api/pom.xml +++ b/demo/api/pom.xml @@ -2,7 +2,7 @@ - org.pf4j.demo + ro.fortsoft.pf4j.demo pom 0.1-SNAPSHOT @@ -34,7 +34,7 @@ - org.pf4j + ro.fortsoft.pf4j pf4j ${project.version} provided diff --git a/demo/api/src/main/java/org/pf4j/demo/api/Greeting.java b/demo/api/src/main/java/org/pf4j/demo/api/Greeting.java deleted file mode 100644 index b21f80c..0000000 --- a/demo/api/src/main/java/org/pf4j/demo/api/Greeting.java +++ /dev/null @@ -1,24 +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 org.pf4j.demo.api; - -import org.pf4j.ExtensionPoint; - -/** - * @author Decebal Suiu - */ -public interface Greeting extends ExtensionPoint { - - public String getGreeting(); - -} diff --git a/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java b/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java new file mode 100644 index 0000000..9a700c2 --- /dev/null +++ b/demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java @@ -0,0 +1,24 @@ +/* + * 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.api; + +import ro.fortsoft.pf4j.ExtensionPoint; + +/** + * @author Decebal Suiu + */ +public interface Greeting extends ExtensionPoint { + + public String getGreeting(); + +} diff --git a/demo/app/pom.xml b/demo/app/pom.xml index d9084b1..38867a9 100644 --- a/demo/app/pom.xml +++ b/demo/app/pom.xml @@ -2,7 +2,7 @@ - org.pf4j.demo + ro.fortsoft.pf4j.demo pom 0.1-SNAPSHOT @@ -22,7 +22,7 @@ - org.pf4j.demo.Boot + ro.fortsoft.pf4j.demo.Boot @@ -75,12 +75,12 @@ - org.pf4j + ro.fortsoft.pf4j pf4j ${project.version} - org.pf4j.demo + ro.fortsoft.pf4j.demo pf4j-demo-api ${project.version} diff --git a/demo/app/src/main/java/org/pf4j/demo/Boot.java b/demo/app/src/main/java/org/pf4j/demo/Boot.java deleted file mode 100644 index b34af53..0000000 --- a/demo/app/src/main/java/org/pf4j/demo/Boot.java +++ /dev/null @@ -1,63 +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 org.pf4j.demo; - -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.pf4j.DefaultPluginManager; -import org.pf4j.ExtensionWrapper; -import org.pf4j.PluginManager; -import org.pf4j.demo.api.Greeting; - -/** - * A boot class that start the demo. - * - * @author Decebal Suiu - */ -public class Boot { - - public static void main(String[] args) { - // print logo - printLogo(); - - // load and start (active/resolved) plugins - final PluginManager pluginManager = new DefaultPluginManager(); - pluginManager.loadPlugins(); - pluginManager.startPlugins(); - - List> greetings = pluginManager.getExtensions(Greeting.class); - for (ExtensionWrapper greeting : greetings) { - System.out.println(">>> " + greeting.getInstance().getGreeting()); - } - - pluginManager.stopPlugins(); - /* - Runtime.getRuntime().addShutdownHook(new Thread() { - - @Override - public void run() { - pluginManager.stopPlugins(); - } - - }); - */ - } - - private static void printLogo() { - System.out.println(StringUtils.repeat("#", 40)); - System.out.println(StringUtils.center("PF4J-DEMO", 40)); - System.out.println(StringUtils.repeat("#", 40)); - } - -} diff --git a/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java new file mode 100644 index 0000000..9a361fa --- /dev/null +++ b/demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java @@ -0,0 +1,64 @@ +/* + * 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; + +import java.util.List; + +import org.apache.commons.lang.StringUtils; + +import ro.fortsoft.pf4j.DefaultPluginManager; +import ro.fortsoft.pf4j.ExtensionWrapper; +import ro.fortsoft.pf4j.PluginManager; +import ro.fortsoft.pf4j.demo.api.Greeting; + +/** + * A boot class that start the demo. + * + * @author Decebal Suiu + */ +public class Boot { + + public static void main(String[] args) { + // print logo + printLogo(); + + // load and start (active/resolved) plugins + final PluginManager pluginManager = new DefaultPluginManager(); + pluginManager.loadPlugins(); + pluginManager.startPlugins(); + + List> greetings = pluginManager.getExtensions(Greeting.class); + for (ExtensionWrapper greeting : greetings) { + System.out.println(">>> " + greeting.getInstance().getGreeting()); + } + + pluginManager.stopPlugins(); + /* + Runtime.getRuntime().addShutdownHook(new Thread() { + + @Override + public void run() { + pluginManager.stopPlugins(); + } + + }); + */ + } + + private static void printLogo() { + System.out.println(StringUtils.repeat("#", 40)); + System.out.println(StringUtils.center("PF4J-DEMO", 40)); + System.out.println(StringUtils.repeat("#", 40)); + } + +} diff --git a/demo/plugin1/plugin.properties b/demo/plugin1/plugin.properties index 9da9bcc..4f95d99 100644 --- a/demo/plugin1/plugin.properties +++ b/demo/plugin1/plugin.properties @@ -1,5 +1,5 @@ plugin.id=welcome-plugin -plugin.class=org.pf4j.demo.welcome.WelcomePlugin +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 index 10c1163..99d467e 100644 --- a/demo/plugin1/pom.xml +++ b/demo/plugin1/pom.xml @@ -2,7 +2,7 @@ - org.pf4j.demo + ro.fortsoft.pf4j.demo pom 0.1-SNAPSHOT @@ -111,13 +111,13 @@ - org.pf4j + ro.fortsoft.pf4j pf4j ${project.version} provided - org.pf4j.demo + ro.fortsoft.pf4j.demo pf4j-demo-api ${project.version} provided diff --git a/demo/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java deleted file mode 100644 index 22ebf7d..0000000 --- a/demo/plugin1/src/main/java/org/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 org.pf4j.demo.welcome; - -import org.pf4j.Extension; -import org.pf4j.Plugin; -import org.pf4j.PluginWrapper; -import org.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/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java new file mode 100644 index 0000000..d10d3dd --- /dev/null +++ b/demo/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"; + } + + } + +} diff --git a/demo/plugin2/plugin.properties b/demo/plugin2/plugin.properties index 60b6f33..0de45e6 100644 --- a/demo/plugin2/plugin.properties +++ b/demo/plugin2/plugin.properties @@ -1,5 +1,5 @@ plugin.id=hello-plugin -plugin.class=org.pf4j.demo.hello.HelloPlugin +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 index 7f4f617..c1b5cb3 100644 --- a/demo/plugin2/pom.xml +++ b/demo/plugin2/pom.xml @@ -2,7 +2,7 @@ - org.pf4j.demo + ro.fortsoft.pf4j.demo pom 0.1-SNAPSHOT @@ -120,13 +120,13 @@ - org.pf4j + ro.fortsoft.pf4j pf4j ${project.version} provided - org.pf4j.demo + ro.fortsoft.pf4j.demo pf4j-demo-api ${project.version} provided diff --git a/demo/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java b/demo/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java deleted file mode 100644 index ad7fd0c..0000000 --- a/demo/plugin2/src/main/java/org/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 org.pf4j.demo.hello; - -import org.pf4j.Extension; -import org.pf4j.Plugin; -import org.pf4j.PluginWrapper; -import org.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/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java b/demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java new file mode 100644 index 0000000..8f12e23 --- /dev/null +++ b/demo/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/pom.xml b/demo/pom.xml index dbb029a..ec642de 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -2,13 +2,13 @@ - org.pf4j + ro.fortsoft.pf4j pom 0.1-SNAPSHOT 4.0.0 - org.pf4j.demo + ro.fortsoft.pf4j.demo pom 0.1-SNAPSHOT pom -- cgit v1.2.3