How can I use different JARs for compiling and testing in maven? -
I compile my program against javaee-api. But for junit testing I should use a specific implementation such as the javaizer of glassfish. To avoid errors such as java.lang.ClassFormatError: The attribute in the absent code attribute that is not original or intangible in the class file javax / persistence / persistence (see also). Avoid using the method, which is only available in the glassfish implementation, I want to compile my artifact with the normal API but execute the junit with the implementation jar. But both offer the same named classes and inferfaces, so the class loader gets bothered. What is the best way to solve this problem? Can I solve this problem with Maven? Thank you very much I think this is possible. In fact, when starting with version 2.0.9, Maven uses POM commands to create a classpath, so that you can manipulate it anymore. And if you combine this with you, then it is possible to achieve whatever you want. In practice, if you have a first javae...