aboutsummaryrefslogtreecommitdiffstats
path: root/demo
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2013-09-25 16:50:37 +0300
committerDecebal Suiu <decebal.suiu@gmail.com>2013-09-25 16:50:37 +0300
commit5cb10a465ebf83e44c6f5009d5e59a66327a154e (patch)
tree615515e288dfd6c7effeea611e0c90f694b02b7d /demo
parentc6cec30c88b98034a97af49aa18e644a6e1b32ca (diff)
downloadpf4j-5cb10a465ebf83e44c6f5009d5e59a66327a154e.tar.gz
pf4j-5cb10a465ebf83e44c6f5009d5e59a66327a154e.zip
put all demo plugins in folder demo/plugins
Diffstat (limited to 'demo')
-rw-r--r--demo/plugin1/plugin.properties5
-rw-r--r--demo/plugin1/pom.xml131
-rw-r--r--demo/plugin1/src/main/assembly/assembly.xml37
-rw-r--r--demo/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java46
-rw-r--r--demo/plugins/plugin2/plugin.properties (renamed from demo/plugin2/plugin.properties)0
-rw-r--r--demo/plugins/plugin2/pom.xml (renamed from demo/plugin2/pom.xml)2
-rw-r--r--demo/plugins/plugin2/src/main/assembly/assembly.xml (renamed from demo/plugin2/src/main/assembly/assembly.xml)0
-rw-r--r--demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java (renamed from demo/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java)0
-rw-r--r--demo/plugins/pom.xml37
-rw-r--r--demo/pom.xml3
10 files changed, 39 insertions, 222 deletions
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 @@
-<?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
index 3fdc464..0000000
--- a/demo/plugin1/src/main/assembly/assembly.xml
+++ /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
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/plugins/plugin2/plugin.properties
index 0de45e6..0de45e6 100644
--- a/demo/plugin2/plugin.properties
+++ b/demo/plugins/plugin2/plugin.properties
diff --git a/demo/plugin2/pom.xml b/demo/plugins/plugin2/pom.xml
index b69f767..62d99fe 100644
--- a/demo/plugin2/pom.xml
+++ b/demo/plugins/plugin2/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>ro.fortsoft.pf4j.demo</groupId>
- <artifactId>pf4j-demo-parent</artifactId>
+ <artifactId>pf4j-demo-plugins</artifactId>
<version>0.5-SNAPSHOT</version>
</parent>
diff --git a/demo/plugin2/src/main/assembly/assembly.xml b/demo/plugins/plugin2/src/main/assembly/assembly.xml
index 5cefe0d..5cefe0d 100644
--- a/demo/plugin2/src/main/assembly/assembly.xml
+++ b/demo/plugins/plugin2/src/main/assembly/assembly.xml
diff --git a/demo/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
index 8f12e23..8f12e23 100644
--- a/demo/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
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 @@
+<?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>
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 @@
<modules>
<module>app</module>
<module>api</module>
- <module>plugin1</module>
- <module>plugin2</module>
+ <module>plugins</module>
</modules>
</project>