开发者

how to change maven plugin's scope

开发者 https://www.devze.com 2023-02-04 11:57 出处:网络
i m using maven-jetty-plugin for my integration test, and it kept complaining java.lang.ClassNotFoundException: org.slf4j.Logger

i m using maven-jetty-plugin for my integration test, and it kept complaining

java.lang.ClassNotFoundException: org.slf4j.Logger

i tried search for the war file in my target folder, in WEB-INF/lib folder no slf4j-api-XX.jar was found even though it's inclu开发者_如何学JAVAded in the project maven dependencies, from the dependency hierarchy[test], i can see slf4j-api's scope was set to 'provided', that's why it won't be included the final file(?), then in my pom.xml i tried to redeclare it as a dependency as:

 <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.5.11</version>
  </dependency>

but still the jar was not included in the final war, thus Jetty was not happy and won't load the app. anyone have any idea how to solve this? Thanks!


Try adding one of the implementations, like

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.6.1</version>
</dependency>

Also, you can add it directly to the Jetty maven plugin if you don't want it included in module.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号