how to change maven plugin's scope
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.
精彩评论