oss-quickstart icon indicating copy to clipboard operation
oss-quickstart copied to clipboard

Suggestion: Create runnable jar by default

Open fwilhe2 opened this issue 3 years ago • 3 comments

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.

fwilhe2 avatar Dec 02 '21 18:12 fwilhe2

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?

gunnarmorling avatar Dec 03 '21 18:12 gunnarmorling

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.

fwilhe2 avatar Dec 04 '21 15:12 fwilhe2

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.

gunnarmorling avatar Dec 04 '21 17:12 gunnarmorling