I have an artifact of war, and I need to use some of their classes from the can. I can’t move the classes to another project, then I deploy the classes and resources included in my webapp as an “attached” artifact using the following configuration:
<plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <attachClasses>true</attachClasses> </configuration> </plugin>
This will lead to the deployment of two artifacts: mywebapp-1.0-SNAPSHOT.war and mywebapp-1.0-SNAPSHOT-classes.jar.
To use these classes, I refer to the artifact as follows:
<dependency> <groupId>mygroup</groupId> <artifactId>mywebapp</artifactId> <version>${project.version}</version> <classifier>classes</classifier> </dependency>
When I compile from Jenkins, everything works correctly, but when I run tests locally from Eclipse, I cannot find reference classes. (Java.lang.NoClassDefFoundError)
I think this might be a bug in the maven eclipse plugin, does anyone have an idea that could happen?
source share