question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't download spring-boot-thin-launcher from a local mirror

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25

github_iconTop GitHub Comments

1reaction
dsyercommented, Sep 6, 2018

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 the simple sample, and it would build a thin (executable) jar and then fail on the thin-maven-plugin. Here’s the error:

...
[ERROR] Failed to execute goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:1.0.14.RELEASE:resolve (resolve) on project simple: Execution resolve of goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:1.0.14.RELEASE:resolve failed.: NoSuchElementException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:1.0.14.RELEASE:resolve (r...
...
Caused by: java.util.NoSuchElementException
	at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:721)
	at java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:742)
	at org.springframework.boot.experimental.maven.ThinJarMojo.resolveFile(ThinJarMojo.java:84)
	at org.springframework.boot.experimental.maven.ResolveMojo.execute(ResolveMojo.java:102)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 28 more

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.

1reaction
dsyercommented, Sep 5, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't get Spring Boot Thin Launcher examples to work
Show activity on this post. I am trying to run the simple app available at https://github.com/dsyer/spring-boot-thin-launcher under samples, ...
Read more >
Thin JARs with Spring Boot - Baeldung
The Spring Boot Thin Launcher is a small library that reads an artifact's dependencies from a file bundled in the archive itself, downloads...
Read more >
Spring Boot Reference Guide
This section provides a brief overview of Spring Boot reference documentation. Think of it as map for the rest of the document. You...
Read more >
How to docker image of spring boot application?-Springboot
Subsequent builds will use this cached version of the mirroring layer, which means that dependencies will be referenced locally without having to pull...
Read more >
Sourcode of JAR files in Maven repository
Explore the sourcecode of the JAR files from the Maven repository. Download the JAR files incl their dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found