首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >缺少项目log4j:log4j:bundle:1.2.17

缺少项目log4j:log4j:bundle:1.2.17
EN

Stack Overflow用户
提问于 2014-02-07 00:54:05
回答 5查看 9.8K关注 0票数 7

我使用menu创建了一个eclipse版本的动态web应用程序:1。之后,我使用configure -> convert to maven project将其转换为maven项目。然后我做了maven->Add dependency,然后搜索log4j。

添加后,将鼠标悬停在log4j的标记上,它会显示缺失的工件log4j:log4j:bundle:1.2.17。我不能使用maven更新依赖项。如何修复它?还请解释错误的原因。

下面是添加log4j后生成的xml。

代码语言:javascript
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Healthcare</groupId>
<artifactId>Healthcare</artifactId>
<version>0.0.1-HEALTHCARE</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
      <warSourceDirectory>WebContent</warSourceDirectory>
      <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
  </plugin>
</plugins>
</build>

<dependencies>
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.17</version>
    <type>bundle</type>
</dependency>
</dependencies>
</project>
EN

回答 5

Stack Overflow用户

发布于 2014-02-07 01:43:33

First why did you changed the default source folder location? The default is src/main/java and for webapp src/main/webapp。除此之外,Maven Central上不存在用于log4j的包,只需从您的依赖项中删除<type>bundle</type>,因为在Maven Central中只有一个jar可用。

票数 6
EN

Stack Overflow用户

发布于 2014-04-03 23:27:42

我总是做下面的小把戏:

在依赖项管理中,我编辑了依赖项属性(选择有问题的依赖项并单击属性按钮),将类型从bundled更改为jar,从而修复了问题。

好吧,我希望这个解决方案对你有效:)尊敬,

票数 3
EN

Stack Overflow用户

发布于 2016-12-31 00:09:36

请检查依赖项是否正确或是否丢失。

代码语言:javascript
复制
<properties>
    <springframework.version>4.2.1.RELEASE</springframework.version>
    <jackson.version>2.5.3</jackson.version>
    <log4j.version>1.2.17</log4j.version>
</properties>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21609093

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档