How to override default packaging when using war/jetty plugin?

Hello everybody

I usually configure my integration tests for my libraries(web based) by using src/test/webapp as the webapp directory. This also allows to me run the instance using jetty plugin(jettyRun) by changing the plugin configuration

jettyRun {
    classpath += files(new File("build/classes/test")) + project.configurations.testRuntime
    webAppSourceDirectory = new File("src/test/webapp")

Now this works fine but if I try to upload the archives(using mavin plugin), gradle packages it as a war (understandable as I am using jetty plugin which depends on war).

Can I override it to publish the library as a jar ?

Thanks Tawus

The simplest way would be to make this a multi project build, with one project being the plain jar and the other being the integration testing harness.

It’s possible to do it all in one project, but the two project approach would be simpler and IDEs cope much better with it.

Would that suffice?

Thanks Luke

Doesn’t seem to be the best of solutions :slight_smile: but thanks anyways.

Would appreciate any pointers for doing it in a single project.

Do you need IDE support?

Thanks for the quick reply.

No, I don’t need IDE support. I use intellj idea and the support for gradle is not that good for now. So I usually run the tests (gradle test) or jetty(gradle jettyRun) from the command line.