pi4j-maven Archetype support via Maven in Intelli Idea

Viewed 65

I want to write java code using the dependency Pi4j and using Intellij on Windows 10. The target platform is a Pi Zero W.

The instructions to develop on remote (Windows 10 in this case) PC say to add the p4j-maven-archetype but don't explain how to use this maven tool within the maven included with Intellij.

I have tried to download the p4j-maven-archetype, extract it, then open Intellij and import p4j-maven-archetype as a project. Then from within Intellij I run the maven goal install so it can be used in other projects.

How would I now create a new project within Intellij using the p4j-maven-archetype that I installed?

Is there a way to package and run it remotely on the Pi from Intellij?

1 Answers

Since this is an archetype that you first need to install into your local Maven repository, follow the steps from corresponding instructions for the archetype project:

Install the archetype to your local .m2 repository Unzip the archetype file in a folder

cd folder/raspimaven-archetype
mvn install

Then use project generation Maven command:

mvn archetype:generate -DarchetypeCatalog=local

Or use IDE wizard to create the project from the locally installed archetype: New Project | Maven -> Create from archetype:

enter image description here

Related