]> source.dussan.org Git - pf4j.git/commitdiff
put all demo plugins in folder demo/plugins
authorDecebal Suiu <decebal.suiu@gmail.com>
Wed, 25 Sep 2013 13:50:37 +0000 (16:50 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Wed, 25 Sep 2013 13:50:37 +0000 (16:50 +0300)
16 files changed:
demo/plugin1/plugin.properties [deleted file]
demo/plugin1/pom.xml [deleted file]
demo/plugin1/src/main/assembly/assembly.xml [deleted file]
demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java [deleted file]
demo/plugin2/plugin.properties [deleted file]
demo/plugin2/pom.xml [deleted file]
demo/plugin2/src/main/assembly/assembly.xml [deleted file]
demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java [deleted file]
demo/plugins/plugin2/plugin.properties [new file with mode: 0644]
demo/plugins/plugin2/pom.xml [new file with mode: 0644]
demo/plugins/plugin2/src/main/assembly/assembly.xml [new file with mode: 0644]
demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java [new file with mode: 0644]
demo/plugins/pom.xml [new file with mode: 0644]
demo/pom.xml
run-demo.bat
run-demo.sh

diff --git a/demo/plugin1/plugin.properties b/demo/plugin1/plugin.properties
deleted file mode 100644 (file)
index 4f95d99..0000000
+++ /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 (file)
index 49cf1df..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    
-    <parent>
-        <groupId>ro.fortsoft.pf4j.demo</groupId>
-        <artifactId>pf4j-demo-parent</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>pf4j-demo-plugin1</artifactId>
-    <version>0.5-SNAPSHOT</version>
-    <packaging>jar</packaging>
-    <name>Demo Plugin #1</name>
-
-    <properties>
-        <plugin.id>welcome-plugin</plugin.id>
-        <plugin.class>ro.fortsoft.pf4j.demo.welcome.WelcomePlugin</plugin.class>
-        <plugin.version>0.0.1</plugin.version>
-        <plugin.provider>Decebal Suiu</plugin.provider>
-        <plugin.dependencies />
-    </properties>   
-
-    <build>
-        <plugins>
-            <!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>properties-maven-plugin</artifactId>
-                <version>1.0-alpha-2</version>
-                <executions>
-                  <execution>
-                    <phase>initialize</phase>
-                    <goals>
-                      <goal>read-project-properties</goal>
-                    </goals>
-                    <configuration>
-                      <files>
-                        <file>plugin.properties</file>
-                      </files>
-                    </configuration>
-                  </execution>
-                </executions>
-            </plugin>
-            -->
-            
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.6</version>
-                <executions>
-                    <execution>
-                        <id>unzip jar file</id>
-                        <phase>package</phase>
-                        <configuration>
-                            <target>
-                                <unzip src="target/${artifactId}-${version}.${packaging}" dest="target/plugin-classes" />
-                            </target>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.3</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>
-                            src/main/assembly/assembly.xml
-                        </descriptor>
-                    </descriptors>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <archive>
-                        <manifestEntries>
-                            <Plugin-Id>${plugin.id}</Plugin-Id>
-                            <Plugin-Class>${plugin.class}</Plugin-Class>
-                            <Plugin-Version>${plugin.version}</Plugin-Version>
-                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
-                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-        
-    <dependencies>
-        <dependency>
-            <groupId>ro.fortsoft.pf4j</groupId>
-            <artifactId>pf4j</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>    
-
-        <dependency>
-            <groupId>ro.fortsoft.pf4j.demo</groupId>
-            <artifactId>pf4j-demo-api</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/demo/plugin1/src/main/assembly/assembly.xml b/demo/plugin1/src/main/assembly/assembly.xml
deleted file mode 100644 (file)
index 3fdc464..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Describes the plugin archive
-  
- @author Decebal Suiu
- @version 1.0
--->
-<assembly>
-       <id>plugin</id>
-       <formats>
-               <format>zip</format>
-       </formats>
-       <includeBaseDirectory>false</includeBaseDirectory>
-       <dependencySets>
-               <dependencySet>
-            <useProjectArtifact>false</useProjectArtifact>
-            <scope>runtime</scope>
-                       <outputDirectory>lib</outputDirectory>
-                       <includes>
-                               <include>*:jar:*</include>
-                       </includes>
-               </dependencySet>
-       </dependencySets>
-    <!--
-    <fileSets>
-        <fileSet>
-            <directory>target/classes</directory>
-            <outputDirectory>classes</outputDirectory>
-        </fileSet>
-    </fileSets>
-    -->
-       <fileSets>
-               <fileSet>
-                       <directory>target/plugin-classes</directory>
-                       <outputDirectory>classes</outputDirectory>
-               </fileSet>
-       </fileSets>
-</assembly>
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 (file)
index d10d3dd..0000000
+++ /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 (file)
index 0de45e6..0000000
+++ /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 (file)
index b69f767..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    
-    <parent>
-        <groupId>ro.fortsoft.pf4j.demo</groupId>
-        <artifactId>pf4j-demo-parent</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>pf4j-demo-plugin2</artifactId>
-    <version>0.5-SNAPSHOT</version>
-    <packaging>jar</packaging>
-    <name>Demo Plugin #2</name>
-
-    <properties>
-        <plugin.id>hello-plugin</plugin.id>
-        <plugin.class>ro.fortsoft.pf4j.demo.hello.HelloPlugin</plugin.class>
-        <plugin.version>0.0.1</plugin.version>
-        <plugin.provider>Decebal Suiu</plugin.provider>
-        <plugin.dependencies />
-    </properties>   
-
-    <build>
-        <plugins>
-            <!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>properties-maven-plugin</artifactId>
-                <version>1.0-alpha-2</version>
-                <executions>
-                    <execution>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>read-project-properties</goal>
-                        </goals>
-                        <configuration>
-                            <files>
-                                <file>plugin.properties</file>
-                            </files>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            -->
-        
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.6</version>
-                <executions>
-                    <execution>
-                        <id>unzip jar file</id>
-                        <phase>package</phase>
-                        <configuration>
-                            <target>
-                                <unzip src="target/${artifactId}-${version}.${packaging}" dest="target/plugin-classes" />
-                            </target>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.3</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>
-                            src/main/assembly/assembly.xml
-                        </descriptor>
-                    </descriptors>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <archive>
-                        <manifestEntries>
-                            <Plugin-Id>${plugin.id}</Plugin-Id>
-                            <Plugin-Class>${plugin.class}</Plugin-Class>
-                            <Plugin-Version>${plugin.version}</Plugin-Version>
-                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
-                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-        
-    <dependencies>
-        <dependency>
-            <groupId>ro.fortsoft.pf4j</groupId>
-            <artifactId>pf4j</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>    
-
-        <dependency>
-            <groupId>ro.fortsoft.pf4j.demo</groupId>
-            <artifactId>pf4j-demo-api</artifactId>
-            <version>${project.version}</version>
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/demo/plugin2/src/main/assembly/assembly.xml b/demo/plugin2/src/main/assembly/assembly.xml
deleted file mode 100644 (file)
index 5cefe0d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
- Describes the plugin archive
-  
- @author Decebal Suiu
- @version 1.0
--->
-<assembly>
-       <id>plugin</id>
-       <formats>
-               <format>zip</format>
-       </formats>
-       <includeBaseDirectory>false</includeBaseDirectory>
-       <dependencySets>
-               <dependencySet>
-            <useProjectArtifact>false</useProjectArtifact>
-            <scope>runtime</scope>
-                       <outputDirectory>lib</outputDirectory>
-                       <includes>
-                               <include>*:jar:*</include>
-                       </includes>
-               </dependencySet>
-       </dependencySets>
-    <!--
-       <fileSets>
-               <fileSet>
-                       <directory>target/classes</directory>
-                       <outputDirectory>classes</outputDirectory>
-               </fileSet>
-       </fileSets>
-    -->
-    <fileSets>
-        <fileSet>
-            <directory>target/plugin-classes</directory>
-            <outputDirectory>classes</outputDirectory>
-        </fileSet>
-    </fileSets>
-</assembly>
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 (file)
index 8f12e23..0000000
+++ /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 (file)
index 0000000..0de45e6
--- /dev/null
@@ -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 (file)
index 0000000..62d99fe
--- /dev/null
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    
+    <parent>
+        <groupId>ro.fortsoft.pf4j.demo</groupId>
+        <artifactId>pf4j-demo-plugins</artifactId>
+        <version>0.5-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>pf4j-demo-plugin2</artifactId>
+    <version>0.5-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Demo Plugin #2</name>
+
+    <properties>
+        <plugin.id>hello-plugin</plugin.id>
+        <plugin.class>ro.fortsoft.pf4j.demo.hello.HelloPlugin</plugin.class>
+        <plugin.version>0.0.1</plugin.version>
+        <plugin.provider>Decebal Suiu</plugin.provider>
+        <plugin.dependencies />
+    </properties>   
+
+    <build>
+        <plugins>
+            <!-- DOESN'T WORK WITH MAVEN 3 (I defined the plugin metadata in properties section)
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>properties-maven-plugin</artifactId>
+                <version>1.0-alpha-2</version>
+                <executions>
+                    <execution>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>read-project-properties</goal>
+                        </goals>
+                        <configuration>
+                            <files>
+                                <file>plugin.properties</file>
+                            </files>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            -->
+        
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.6</version>
+                <executions>
+                    <execution>
+                        <id>unzip jar file</id>
+                        <phase>package</phase>
+                        <configuration>
+                            <target>
+                                <unzip src="target/${artifactId}-${version}.${packaging}" dest="target/plugin-classes" />
+                            </target>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.3</version>
+                <configuration>
+                    <descriptors>
+                        <descriptor>
+                            src/main/assembly/assembly.xml
+                        </descriptor>
+                    </descriptors>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <archive>
+                        <manifestEntries>
+                            <Plugin-Id>${plugin.id}</Plugin-Id>
+                            <Plugin-Class>${plugin.class}</Plugin-Class>
+                            <Plugin-Version>${plugin.version}</Plugin-Version>
+                            <Plugin-Provider>${plugin.provider}</Plugin-Provider>
+                            <Plugin-Dependencies>${plugin.dependencies}</Plugin-Dependencies>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+        
+    <dependencies>
+        <dependency>
+            <groupId>ro.fortsoft.pf4j</groupId>
+            <artifactId>pf4j</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>    
+
+        <dependency>
+            <groupId>ro.fortsoft.pf4j.demo</groupId>
+            <artifactId>pf4j-demo-api</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/demo/plugins/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml
new file mode 100644 (file)
index 0000000..5cefe0d
--- /dev/null
@@ -0,0 +1,37 @@
+<!--
+ Describes the plugin archive
+  
+ @author Decebal Suiu
+ @version 1.0
+-->
+<assembly>
+       <id>plugin</id>
+       <formats>
+               <format>zip</format>
+       </formats>
+       <includeBaseDirectory>false</includeBaseDirectory>
+       <dependencySets>
+               <dependencySet>
+            <useProjectArtifact>false</useProjectArtifact>
+            <scope>runtime</scope>
+                       <outputDirectory>lib</outputDirectory>
+                       <includes>
+                               <include>*:jar:*</include>
+                       </includes>
+               </dependencySet>
+       </dependencySets>
+    <!--
+       <fileSets>
+               <fileSet>
+                       <directory>target/classes</directory>
+                       <outputDirectory>classes</outputDirectory>
+               </fileSet>
+       </fileSets>
+    -->
+    <fileSets>
+        <fileSet>
+            <directory>target/plugin-classes</directory>
+            <outputDirectory>classes</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
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 (file)
index 0000000..8f12e23
--- /dev/null
@@ -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 (file)
index 0000000..9420816
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    
+    <parent>
+        <groupId>ro.fortsoft.pf4j.demo</groupId>
+        <artifactId>pf4j-demo-parent</artifactId>
+        <version>0.5-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>ro.fortsoft.pf4j.demo</groupId>
+    <artifactId>pf4j-demo-plugins</artifactId>
+    <version>0.5-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <name>Demo Plugins Parent</name>
+
+    <build>
+        <resources>
+            <resource>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
+
+    <modules>
+        <module>plugin1</module>
+        <module>plugin2</module>
+    </modules>
+
+</project>
index 76bd4d700b6310e90391438eeb6cf0eef57cef18..2c7f277d0e026d6e0764280c36efd554b9680a39 100644 (file)
@@ -32,8 +32,7 @@
     <modules>
         <module>app</module>
         <module>api</module>
-        <module>plugin1</module>
-        <module>plugin2</module>
+        <module>plugins</module>
     </modules>
 
 </project>
index 05c53dfc4cb8c2edce28af93d6510647fc172940..0edca593f897a105dad2a2d04344767d40008c26 100644 (file)
@@ -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
 
index ce68e5bbcc14425174101a8922032b7834b39de7..724d68b0a9e4afefde6a3dba6b3611d45260dc29 100755 (executable)
@@ -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