【问题标题】:How to run Maven project in Eclipse by importing it from github如何通过从 github 导入来在 Eclipse 中运行 Maven 项目
【发布时间】:2018-08-19 10:01:33
【问题描述】:

我是 Java 和 maven 的新手,我只需要运行它 https://github.com/att/XACMLMaven 项目。

任何人请给我一些指导方针,如果我在 Eclipse 中构建它,我会收到这些错误。
我需要安装gpg 软件,因为我对gpg 不太了解,因为我是新手。

[INFO] --- maven-failsafe-plugin:2.19.1:verify (integration-tests) @ att-xacml ---
[INFO] 
[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ att-xacml ---
'gpg.exe' is not recognized as an internal or external command,
operable program or batch file.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] ATT XACML 2.0.0-SNAPSHOT ........................... FAILURE [ 19.653 s]
[INFO] att-xacml .......................................... SKIPPED
[INFO] att-xacml-pip ...................................... SKIPPED
[INFO] att-xacml-pdp ...................................... SKIPPED
[INFO] xacml-test ......................................... SKIPPED
[INFO] xacml-rest ......................................... SKIPPED
[INFO] xacml-pdp-rest ..................................... SKIPPED
[INFO] xacml-pap-rest ..................................... SKIPPED
[INFO] xacml-pap-admin 2.0.0-SNAPSHOT ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:54 min 

一旦成功,我需要知道如何运行:

mvn jetty:run-war

【问题讨论】:

    标签: eclipse maven m2e


    【解决方案1】:

    错误消息中重要的部分高于您发布的内容。
    例如见att/XACML issue 30:

    [INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ att-xacml ---
    gpg: signing failed: Inappropriate ioctl for device
    gpg: signing failed: Inappropriate ioctl for device
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] ATT XACML .......................................... FAILURE [  2.712 s]
    

    该错误已通过 Java 更新解决,因此请仔细检查您在 Eclipse 中使用的 Java。


    在 OP 的情况下,错误是:

    'gpg.exe' is not recognized as an internal or external command,
    operable program or batch file.
    

    这仅仅意味着您需要从识别 gpg.exe 的 CMD 会话中启动 Eclipse:

    gpg.exe --version
    gpg (GnuPG) 2.0.29 (Gpg4win 2.3.0)
    

    在 CMD 中检查您的 %PATH%

    set PATH
    

    并相应调整:

    set PATH=C:\path\to\gpg;%PATH%
    

    然后启动 Eclipse,并在其中运行 maven。


    OP 补充说:

    如何访问本地主机的控制台?
    比如我可以在哪里运行这个命令 (mvn jetty:run-war) 以及如何运行。

    参见“Is there any tool in eclipse to run maven commands directly?”:假设您已经安装了m2e (M2Eclipse) Eclipse,您将能够使用define a maven "run configuration"

    在“Sonatype: Developing with Eclipse and Maven / 4.2. Running Maven Builds”中查看更多信息。

    对于mvn jetty:run,具体参见“how to run a web service maven project on jetty 8 from eclipse?”。

    【讨论】:

    • 我无法理解我只需要按照这些步骤操作。打开终端窗口并 cd 到 XACML-PAP-REST 子目录。 'mvn jetty:run-war' 默认运行在 localhost:9090/pap
    • @AtherAbdulJabbar books.sonatype.com/m2eclipse-book/reference/…的哪一步你不明白?
    • 是的,但现在我被困在这个 [INFO] Started ServerConnector@53f7a906{HTTP/1.1,[http/1.1]}{0.0.0.0:9090} [INFO] Started @121084ms [INFO ] 启动码头服务器
    • @AtherAbdulJabbar 请创建一个新问题,并附上您当前“运行配置”的屏幕截图。那里会更容易回答。
    猜你喜欢
    • 1970-01-01
    • 2011-06-16
    • 2016-11-04
    • 1970-01-01
    • 2010-10-29
    • 1970-01-01
    • 2016-12-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多