Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven failsafe plugin gotcha #133

Open
fabiosimeoni opened this issue Feb 19, 2019 · 0 comments
Open

Maven failsafe plugin gotcha #133

fabiosimeoni opened this issue Feb 19, 2019 · 0 comments

Comments

@fabiosimeoni
Copy link

I've spent quite some time wondering why my integration tests would fail from the command line and not from the IDE. My Application entrypoint would simply be ignored, along with all resources and providers in my main application.

Eventually I'd narrowed this down to a combination of how kumuluz works in exploded mode and the default behaviour of the failsafe plugin, which I use to start and stop a database required for integration tests. The plugin runs after the package phase, hence after the uberjar has been created. Finding a build artefact it adds it to the classpath in lieu of the target/classes. JettyServletServer however expects to look into target\classes in exploded mode, hence fails to pick up the components (unless one adds the current project to scan-libraries, which is totally weird`).

Fortunately, one can configure explicitly this on the failsafeplugin:

<classesDirectory>${project.build.outputDirectory}</classesDirectory>

which tells it to prefertarget\classes over the built jar.

I'm reporting this because it's obscure and it's worth sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant