我想使用依赖项 Pi4j 编写 java 代码并在 Windows 10 上使用 Intellij。目标平台是 Pi Zero W。
instructions在远程(在本例中为 Windows 10)PC 上开发说要添加 p4j-maven-archetype但不解释如何在 Intellij 附带的 maven 中使用此 maven 工具。
我尝试下载 p4j-maven-archetype,将其解压缩,然后打开 Intellij 并将 p4j-maven-archetype 作为项目导入。然后我在 Intellij 中运行 maven goal install,这样它就可以在其他项目中使用。
我现在如何使用我安装的 p4j-maven-archetype 在 Intellij 中创建一个新项目?
有没有办法通过 Intellij 在 Pi 上远程打包和运行它?
最佳答案
由于这是您首先需要安装到本地 Maven 存储库中的原型(prototype),请按照相应 instructions 中的步骤进行操作对于原型(prototype)项目:
Install the archetype to your local .m2 repository Unzip the archetype file in a folder
cd folder/raspimaven-archetype
mvn install
然后使用项目生成Maven命令:
mvn archetype:generate -DarchetypeCatalog=local
或者使用 IDE 向导从本地安装的原型(prototype)创建项目:New Project | Maven -> 从原型(prototype)创建:
关于java - pi4j-maven 原型(prototype)支持通过 Intellij Idea 中的 Maven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69958802/