Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0.9, 3.0
-
Fix Version/s: None
-
Component/s: Dependencies
-
Labels:None
-
Environment:Microsoft Windows XP [Version 5.1.2600]
-
Complexity:Intermediate
-
Number of attachments :3
Description
Try to compile the trivial project attached (w/ possibly non-trivial dependencies).
Note: you may have to manually install some of the dependencies; pdf-box is probably the only one like that. But you removing it from pom doesn't appear to resolve the issue either, so you can probably just remove it.
-
Hide
- maven-2-bug.zip
- 21/Jul/08 12:01 PM
- 5 kB
- Reshat Sabiq
-
- META-INF/MANIFEST.MF 0.1 kB
- .classpath 0.5 kB
- .project 0.6 kB
- pom.xml 3 kB
- project.xml 5 kB
- src/main/java/.../maven/Maven2Bug.java 0.4 kB
- src/main/resources/log4j.properties 0.3 kB
-
Hide
- maven-2-bug-cleaner.zip
- 21/Jul/08 12:22 PM
- 4 kB
- Reshat Sabiq
-
- .classpath 0.5 kB
- .project 0.6 kB
- pom.xml 2 kB
- project.xml 5 kB
- src/main/java/.../maven/Maven2Bug.java 0.4 kB
- src/main/resources/log4j.properties 0.3 kB
-
Hide
- maven-2-bug-cleaner-with-pdfbox.zip
- 21/Jul/08 12:30 PM
- 4 kB
- Reshat Sabiq
-
- .classpath 0.5 kB
- .project 0.6 kB
- pom.xml 2 kB
- project.xml 5 kB
- src/main/java/.../maven/Maven2Bug.java 0.4 kB
- src/main/resources/log4j.properties 0.3 kB
Activity
Use maven-2-bug-cleaner.zip instead of maven-2-bug.zip to reproduce, because it is a bit cleaner, and actually prints stuff from log4j, if executed.
maven-2-bug-cleaner-with-pdfbox.zip is the same as maven-2-bug-cleaner.zip, but has a pdfbox dependency.
Your POM states
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> <scope>runtime</scope> </dependency>
Note the <scope> element. You are effectively telling Maven that Log4J is only required for running (and testing) the project. However, you need it for compilation. So either change the affected dependencies to <scope>compile</scope> or simply remove the <scope> element.
The project successfully builds from Eclipse w/ Q for Eclipse plugin.
Keep in mind that Eclipse has only one build path, i.e. does not distinguish between compile, runtime and test class path. As such, all dependencies end up on your Eclipse build path, obscuring the effect of a bad POM.
I was under mistaken assumption that runtime scope included compile scope. My bad. Closing...
Runtime scope doesn't include compile scope: bad pom, not a bug.
The project successfully builds from Eclipse w/ Q for Eclipse plugin.
It also successfully builds w/ maven 1, using project.xml in the attachment.