You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maven构建Install4j 11.0.3时Log4j2日志组件缺失报错咨询

Install4j Maven插件构建时Log4j2警告问题分析

我们使用以下Maven插件构建Install4j:

<groupId>com.install4j</groupId>
<artifactId>install4j-maven</artifactId>
<version>11.0.3</version>

构建机器已安装Install4j 11.0.3,且已配置installDir属性指向其安装目录。构建时出现如下日志信息:

[INFO] Loading config file setup.install4jERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
[INFO]
[INFO] Creating media file

问题结论

这是Install4j 11.0.3 Maven插件本身的依赖配置问题,不属于你的配置错误。

原因说明

该版本的插件引入了Log4j2的API依赖,但未包含对应的核心实现(log4j-core),导致运行时无法找到日志实现,只能降级使用SimpleLogger输出日志。不过这个警告不会影响Install4j的媒体文件构建流程,从日志中的Creating media file可以看出构建仍在正常推进。

消除警告的方案

如果需要消除该警告,可以手动在Maven插件的依赖中添加log4j-core依赖,选择与插件兼容的版本即可,示例配置如下:

<plugin>
    <groupId>com.install4j</groupId>
    <artifactId>install4j-maven</artifactId>
    <version>11.0.3</version>
    <configuration>
        <installDir>你的Install4j安装目录路径</installDir>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.17.1</version>
        </dependency>
    </dependencies>
</plugin>

内容的提问来源于stack exchange,提问作者Gregor G.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 01:09:53