moditect / oss-quickstart

Apache Maven artifacts for bootstrapping new open-source projects
Apache License 2.0
63 stars 5 forks source link

Suggestion: Create runnable jar by default #17

Open fwilhe2 opened 2 years ago

fwilhe2 commented 2 years ago

I like this archetype :+1:

I guess this might be a bit controversial, not sure if this is inside the scope of this archetype, but I'd propose to add a main method and set it so we get a jar that can be run with java -jar target/app.jar.

Honestly that is something where I always need to look up how to do it again, so it would be really nice if it was an (optional?) feature of this archetype.

gunnarmorling commented 2 years ago

Yes, I think that's a good idea. Not even sure whether it's that controversial, we could also make this an option in the archetype. Would you perhaps be interested in sending a PR?

fwilhe2 commented 2 years ago

So I assume it would make sense to have this as an option, but then there are follow up questions like should it be a shaded/shadow jar. Not sure what the best general purpose way to do that is, but it might be a good opportunity to do some research into this.

gunnarmorling commented 2 years ago

So I assume it would make sense to have this as an option

+1 Yes, either an option, or having two separate archetypes, one for libraries, one for applications. If we can get away with the option, that'd be my preference.

but then there are follow up questions like should it be a shaded/shadow jar

I don't think it should. Fat JARs are not a good practice IMO, in particular preventing efficient updates of Linux container images with layered file systems. I'd rather not proliferate their usage via this archetype.