[
https://issues.apache.org/jira/browse/MDEP-773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424946#comment-17424946
]
Eric Lilja commented on MDEP-773:
---------------------------------
Just saw the same issue in one of our projects. The module is a test utility
that puts junit in scope compile (by default scope test in parent), because it
contains classes (in src/main/java) that extend a class (ExternalResource) in
the junit.jar. Apart that use of ExternalResource, our classes in src/main/java
do not reference anything else in the JUnit jar file
mvn dependency:analyze says:
[WARNING] Non-test scoped test only dependencies found:
[WARNING] junit:junit:jar:4.13.2:compile
Which is an incorrect warning. This is with version 3.2.0, downgrading to 3.1.2
solves the issue
> Getting Warning : Non-test scoped test only dependencies found
> --------------------------------------------------------------
>
> Key: MDEP-773
> URL: https://issues.apache.org/jira/browse/MDEP-773
> Project: Maven Dependency Plugin
> Issue Type: Bug
> Components: analyze
> Affects Versions: 3.2.0
> Environment: Windows 10
> Reporter: Venkata Ramana Gujja
> Priority: Critical
> Attachments: demo.zip
>
>
> I am getting below warning even after I have declared the dependency in
> pom.xml. I am executing the command mvn dependency:analyze. I am using
> @Autowired Java class from spring beans in a JUnit test.
> [WARNING] Non-test scoped test only dependencies found:
> [WARNING] org.springframework:spring-beans:jar:5.3.10:compile
>
> I have declared below dependency in pom.xml
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-beans</artifactId>
> <version>5.3.10</version>
> </dependency>
>
> I have attached demo maven project.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)