Details
Description
I have 2 projects as seen in the attached files.
My first project contains a single interface that defines a String constant.
My second project, uses the String constant from my first project.
When i try to use dependency:analyze to fail the build as seen below, i can't make the system work.
If i add the dependency from project 2 to project 1, i get:
[INFO] [dependency:analyze {execution: analyze}] [INFO] Used declared dependencies: [INFO] None [INFO] Used undeclared dependencies: [WARNING] None [INFO] Unused declared dependencies: [INFO] test:project1:jar: 1.0-SNAPSHOT:compile [WARNING] Potential problems discovered.
But if i remove it, i get:
If i remove the supposedly unused dependency, then I get a compile error:
[INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure C:\ASSIA\development\maven_bug\project2\src\main\java\project2\NamesUser.java:[6,24] package project1 does not exist
Here is the build definition i have...
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>analyze</id> <phase>package</phase> <goals> <goal>analyze</goal> </goals> <configuration> <failBuild>true</failBuild> <ignoreDirect>false</ignoreDirect> </configuration> </execution> </executions> </plugin> </plugins> </build>
Attachments
Attachments
Issue Links
- depends upon
-
MSHARED-253 add a way to force used dependencies when they are detected as unused (because of bytecode analysis)
- Closed
- is depended upon by
-
MDEP-124 Dependency incorrectly reported as "Unused declared"
- Closed
- is duplicated by
-
MDEP-176 excludes not considered in analyze?
- Closed
-
MDEP-210 Support includes/excludes configuration in analyze
- Closed
- is related to
-
MDEP-289 Incorrect warning with javax.xml
- Open