3

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?

Al Grant
  • 2,102
  • 1
  • 26
  • 49
  • in IntelliJ IDEA navigate to "File > New Project > Maven ", tick the "From archetype" option, and choose the downloaded archetype using the "Add archetype" button: https://i.imgur.com/Lq4mqeS.png – Konstantin Annikov Nov 15 '21 at 07:36

1 Answers1

1

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

Andrey
  • 15,144
  • 25
  • 91
  • 187