spring-boot-thin-launcher: Can't download spring-boot-thin-launcher from a local mirror
I’m trying to force download the launcher from a local mirror using thin.repo
key (from the sources)
mvn package -Dthin.repo=http://nexus.local/repository/maven-public/
but doesn’t work. Always try to download from repo.spring.io.
I also have a custom settings.xml in .m2 but is ignore or overriding by launcher pom.
In the sources, it looks like it could use thin.repo property but is ignored.
Any suggestion.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25
That’s a better docker strategy TBH than using the thin launcher (but as I said above you can improve it by using the application main class).
I have reproduced the original issue. It’s incredibly fiddly to get the networks set up, but it is possible. I’m not sure I could automate it, but I can probably document it at least.
FWIW I could run
mvn package
on thesimple
sample, and it would build a thin (executable) jar and then fail on thethin-maven-plugin
. Here’s the error:The executable jar is also not executable until the launcher is cached locally. To do that (which would be another workaround for you), you can specify
--thin.repo=http://<your-mirror>
on the command line when you run it. I think to close this issue we need a way to do that in the Maven plugin as well.N.B. even if the launcher is cached locally, the Maven plugin still fails. So that’s what I plan to fix first.
That’s not really a workaround: that’s the best way to build a single fixed docker container for a Spring Boot app. It would start quicker if you used the main class instead of the
JarLauncher
, but that’s irrelevant for the file system layers.A thin jar is executable but not self-contained. If that’s what you want you don’t need the thin-maven-plugin (just the layout in the Spring Boot plugin). You can build the jar and execute it as above.
By not using the plugin. I already suggested that, so probably you misunderstood. Just use the regular Spring Boot plugin with the thin layout (you already had that in your pom).
But if your main focus is building a custom docker container, and you don’t need multiple containers with different classpaths, I would just use the regular Spring Boot fat jar, if I were you. The application code is in
BOOT-INF/classes
and the dependencies are inBOOT-INF/lib
so it’s easy to create efficient file system layers. I don’t know what the thin launcher would give you in that scenario that would be of use.Still a bit thin on detail. Can we see the pom.xml and the relevant sections from settings.xml?