java - pi4j-maven 原型(prototype)支持通过 Intellij Idea 中的 Maven

标签 java maven intellij-idea pi4j

我想使用依赖项 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)创建:

enter image description here

关于java - pi4j-maven 原型(prototype)支持通过 Intellij Idea 中的 Maven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69958802/

相关文章:

java - Jasperreport CSV UTF-8 没有 BOM 而不是 UTF-8

maven - 如何仅使用公司本地关系存储库

java - 无法使用 Guice 的方法 createInjector 找到符号

java - 使用 Spring Framework Cloud 时无法将 Artifact 从中央 Maven 存储库传输到中央 Maven 存储库

node.js - WebStorm 已将目录中的所有文件标记为非项目文件

javascript - 带有 IntelliJ IDEA 的 Vertx JavaScript "ClassNotFoundException"

vim - Intellij Ideavim 如何设置 <ESC> 的按键映射

java - 如何在 Java 中读取 Java 进程的 Windows "Virtual Bytes"性能计数器?

java - 更改 Guice 参数配置

java - 功能接口(interface)映射的正确键入 (Java 8)