Netbeans的+爪哇9个模块+的Log4j 2.11 =模块未找到

问题描述 投票:2回答:1

我使用Apache的Netbeans 9测试版9(2018 2月22日)。我有一个Java 9模块应用。我想Log4j 2融入我的应用程序。这是我的modile-info.java

module ru.itlect.remka.agent {

    exports ru.itlect.remka.agent;

    requires ru.itlect.remka.commons;
    requires org.apache.logging.log4j.core;
    requires org.apache.logging.log4j;

    requires static spring.context;
    requires java.logging;
    requires java.xml;
    requires java.sql;
    requires java.desktop;
    requires java.naming;
    requires java.rmi;

    requires static javafx.graphics;
    requires static javafx.controls;
}

Netbeans的说,org.apache.logging.log4j模块没有找到。虽然org.apache.logging.log4j.core是OK。当我生成项目,它成功建立。所以,问题是在Netbeans的本身。 java --list-modules说,org.apache.logging.log4jlog4j-api-2.11.0.jar。如果键入requeres log Netbeans的建议了log4j.api log4j-api-2.11.0.jar其自动模块名称。认为Netbeans的说,log4j.api为O-发现无论是。

我可以在module-info.java不断的错误消息活着,但Netbeans的看不到任何类log4j-api-2.11.0.jar所以我在使用记录器的任何类有错误。如何使Netbeans中看到的模块?

这是从我的pom.xml的一部分:

<dependencies>

    <!-- Ремка -->
    <dependency>
        <groupId>ru.itlect.remka</groupId>
        <artifactId>commons</artifactId>
        <version>1.0.0</version>
    </dependency>

    <!--Spring-->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>5.0.6.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>5.0.6.RELEASE</version>
    </dependency>

    <!-- Аннотации -->
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.5</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- Logs -->
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.11.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.11.0</version>
    </dependency>
</dependencies>
java maven netbeans log4j java-9
1个回答
0
投票

我也遇到了麻烦,更新某些应用程序使用Log4j2 V2.11.1作为一个模块。我创建了一个简单的测试案例,并提出它在NetBeans用户邮件列表。

由于今天早上,在Netbeans的9最新发布的错误被发现和修复。 Pull request 941,今天上午这Geertjan批准,解释说。邮件列表([email protected])包含被合并成一个新的版本为各地提前修复该问题的建议。新版本正在进入NetCAT (Community Acceptance Testing)过程。开发商希望得到社会的帮助,以更快的完成它,这可能是最好的前进方式。

如果您需要立即解决,从讨论一个建议的方法是编辑jar文件的模块info.class文件移动到根结构。

© www.soinside.com 2019 - 2024. All rights reserved.