How can I keep a dependency out of all classpaths?

I do have a dependency in my project that produces a ZIP full of resources. 
None of those resources is actually of any use for the Java compiler; they 
solely serve as an input to third party plugins (not dealing with Java at all). 
Unfortunately the Maven Compiler plugin sees that ZIP and tries to read it, 
leading to error messages as the ZIP is in an "unexpected" format (for now 
let's just say, it is intentionally incompatible). So the question is, how to 
tell Maven to not put that dependency on ANY Java classpath?


  1.  "runtime" Scope: compile is happy now, but test-compile still fails
  2.  Moving the dependency from being a project dependency to being a 
plugin-specific dependency: compile and test-compile are happy now, but -am 
doesn't build the dependency anymore and dependency:tree (and other scanners) 
does not tell me about the existence oft hat dependency at all
  3.  "resource" Scope: would be exactly what I like to do, but Maven does not 
have such a scope: compile and test-compile would be happy, and -am still would 
build the dependency just like other scanners it would still see the dependency

In the end, the bigger question actually is, how to tell ANY plugin to ignore 
particular dependencies of my POM? Just because my project is of type WAR does 
not mean that EVERYTING it depends upon shall be processed by the Java 
toolchain... Maybe it would be better if the Maven Compiler Plugin JUST puts 
those dependencies on the classpath that actually are JARs...?

Thanks a lot!
-Markus

Reply via email to