Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
provide an Archetype for new PF4J based projects #306
To make using PF4J for new developers as easy as possible, we might consider providing a Maven Archetype. A developer might just enter a command like
mvn archetype:generate \ -DarchetypeGroupId=org.pf4j \ -DarchetypeArtifactId=pf4j-application \ -DarchetypeVersion=3.0.0 \ -DgroupId=com.mycompany \ -DartifactId=myapplication
and automatically a basic Maven project structure is created, from which he can start the development of his new PF4J based application. The created project might use the same (or similar) files, that are used in the demo application (see #304).
I've never created those Archetypes yet, but according to the documentation it looks quite simple to me. What do you think about this?
A Quickstart Archetype is welcome in my opinion. In this mode you have a functional demo application without being forced to refactorize (change the root package name, application name, ...).
Due to a lot of work I did not had the the time to start this feature yet. I guess I would need about one or two more weeks. If you don't want to wait for so long, feel free to create the archetype by yourself.
Maybe it's even better, because you're using a different structure for your projects / plugins (e.g. using the development classpath). ;)
To create a new basic PF4J application you call the quickstart archetype with a command like:
Please replace holders (
For example, if I want to create a quickstart PF4J application with name
After the command is executed, your PF4J application is available in
The quickstart archetype is based on the demo project with some modifications:
The first step after you create a new PF4J application via quickstart archetype is to create the artifacts using
app/target/ -rw-r--r-- 1 decebal decebal 5525 mai 16 22:01 myproject-app-1.0-SNAPSHOT.jar -rw-r--r-- 1 decebal decebal 872934 mai 16 22:01 myproject-app-1.0-SNAPSHOT.zip
plugins/hello/target: -rw-r--r-- 1 decebal decebal 3399 mai 16 22:01 hello-plugin-1.0-SNAPSHOT-all.jar -rw-r--r-- 1 decebal decebal 3193 mai 16 22:01 hello-plugin-1.0-SNAPSHOT.jar plugins/welcome/target: -rw-r--r-- 1 decebal decebal 289149 mai 16 22:01 welcome-plugin-1.0-SNAPSHOT-all.jar -rw-r--r-- 1 decebal decebal 3451 mai 16 22:01 welcome-plugin-1.0-SNAPSHOT.jar
The plugins are released in JAR format (as fat/uber jars => include dependencies).
For Linux (I use Linux), I supplied out of the box a very tiny script
Now, it's very easy to run your application (with plugins), follow the below steps:
If you need to distribute your application then zip the