繁体   English   中英

ActiveMQ Artemis示例的Maven编译中的NotDirectoryException

[英]NotDirectoryException on maven compilation of ActiveMQ Artemis example

首先,我对这个问题进行了研究,但没有找到解决问题的方法,因此我开始:

我正在尝试运行Apache ActiveMQ Artemis(2.5.0)的最新版本提供的示例,该示例是protocol / mqtt / publish-subscribe一个。 正如Apache所说,我尝试在目录中运行mvn verify 问题是,它不起作用。 我把输出放在这里,无论如何我都尝试了-e和-X,所以不要犹豫问我这个堆栈跟踪的帖子。

(因为/Library/[....]/lib/modules当然不是目录,而是文件。我实际上不知道它的作用,但是我尝试重命名它并创建一个名为“模块”,而当我尝试运行其他内容时,它只是创建了错误。)

[INFO] Scanning for projects...
[INFO] 
[INFO] --------< org.apache.activemq.examples.mqtt:publish-subscribe >---------
[INFO] Building ActiveMQ Artemis MQTT Publish/Subscribe Example 2.5.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-java) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ publish-subscribe ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/bouvet/ARTEMIS/apache-artemis-2.5.0/examples/protocols/mqtt/publish-subscribe/src/main/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ publish-subscribe ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/bouvet/ARTEMIS/apache-artemis-2.5.0/examples/protocols/mqtt/publish-subscribe/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.024 s
[INFO] Finished at: 2018-04-23T16:17:15+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project publish-subscribe: Fatal error compiling: CompilerException: InvocationTargetException: java.nio.file.NotDirectoryException: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/modules -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

编辑:我试图将此包含到我的pom.xml中:

    <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.7.0</version>
               <configuration>
                   <source>1.8</source>
                   <target>1.8</target>
               </configuration>
            </plugin>
        </plugins>
   </build>

或这个 :

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

但这并没有改变任何东西:(

编辑II:正如贾斯汀·贝特拉姆(Justin Bertram)所建议的那样,通过一些研究,我决定至少使用该项目来修改默认使用的JDK,至少对于该项目而言

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_162`

那可能不是最好的方法,因为我可能不得不再次对其进行更改才能与Java 9一起使用,但至少它可以做到这一点。 我现在有一些依赖问题,但是我认为这不是谈论的地方,我认为这个问题已经解决。

看来您正在使用Java 9,Apache ActiveMQ Artemis尚不支持Java 9。 尝试使用Java 8,我想您会看到示例按预期运行。 使用时对我有效:

$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM