I run mvn dependency:analyze
command to check the unused jar in my java project, part of the result as bellow:
[WARNING] Unused declared dependencies found: [WARNING]
org.springframework.boot:spring-boot-starter:jar:2.0.3.RELEASE:comp ile [WARNING]
org.springframework.boot:spring-boot-starter-test:jar:2.0.3.RELEASE :compile [WARNING]
org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.3.RELEASE :compile [WARNING]
org.springframework.boot:spring-boot-starter-actuator:jar:2.0.3.REL EASE:compile [WARNING] org.aspectj:aspectjweaver:jar:1.8.9:compile [WARNING]
But spring-boot-starter-test
is actually used in src/test/java package,
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class TestClass {
...
}
I want to know why spring-boot-starter-test: appear in Unused declared dependencies found section.
Is there a way to find the exact jar which is not used in my java project