provide an Archetype for new PF4J based projects
See original GitHub issueTo 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?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Quickstart - PF4J
The quickstart will set up a ready-to-use project in under a minute (depending on your ... artifactId and archetypeVersion (the latest PF4J version)....
Read more >Maven Archetype β About
To create a new project based on an Archetype, you need to call mvn archetype:generate goal, like the following: mvn archetype:generate. PleaseΒ ...
Read more >archetype-catalog.xml - Nexus Repository Manager
am.ik.archetype elm-spring-boot-blank-archetype 0.0.4-SNAPSHOT Blank multi ... velcro 1.0.0-SNAPSHOT This project provides a awesome Maven archetype forΒ ...
Read more >Introducing the OSS Quickstart Archetype - Gunnar Morling
When bootstrapping new Maven-based projects, be it long-running ones, ... archetype is meant as a fresh alternative, not only providing moreΒ ...
Read more >Plugin Project Configuration - Spinnaker
The easiest way to set up a new plugin project is to copy one of the ... "An example of a PF4J based...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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). π
Finally, we have support for Maven Archetype. The archetypes are available in maven-archetypes directory. For the moment is available only quickstart.
To create a new basic PF4J application you call the quickstart archetype with a command like:
Please replace holders (
@*@) with what you want.For example, if I want to create a quickstart PF4J application with name
myproject, with the root packagecom.mycompanyusing PF4J version3.0.0-SNAPSHOTI will execute the command:After the command is executed, your PF4J application is available in
myprojectdirectory. The structure ofmyprojectdirectory is:The quickstart archetype is based on the demo project with some modifications:
apimodule was removed for simplicity and the content of this module (theGreetingextension point) was merged in theappmoduleThe first step after you create a new PF4J application via quickstart archetype is to create the artifacts using
mvn clean package. The result of this command is:targetdirectory of app)targetdirectory of each plugin)The plugins are released in JAR format (as fat/uber jars => include dependencies). The application jar contain in manifest the main class and the classpath.
For Linux (I use Linux), I supplied out of the box a very tiny script
run.shthat build and run your application. After you create the application, run this script and that is all. NOTE Before runrun.shscript add execution permission with commandchmod u+x run.sh.The
run.shcreates a very simple and clean structure for you application, structure availables in a newdist(from distribution) directory:Now, itβs very easy to run your application (with plugins), follow the below steps:
distdirectory (cd dist)java -jar *.jaror more explicitlyjava -jar myproject-app-1.0-SNAPSHOT.jaror double click on the jar file).If you need to distribute your application then zip the
distdirectory and send the zip file.