Git Product home page Git Product logo

spring-boot-thin-launcher's People

Contributors

aleksimpson avatar bsideup avatar dependabot[bot] avatar dsyer avatar jjelliott avatar jlleitschuh avatar loosebazooka avatar marcingrzejszczak avatar markfisher avatar mrbitrary avatar spring-operator avatar stefanocke avatar stephlag avatar sudharakap avatar wilkinsona avatar yesid-bocanegra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-thin-launcher's Issues

Command line options for debug/trace output specifically to log dependency resolution outcomes

I've just added the thin launcher to Spring Restbucks and it generally works like a charm.

However, I tried to get some insight into what the launcher is doing but failed to get any output:

java -Dthin.trace=true -jar target/restbucks-1.0.0.BUILD-SNAPSHOT.jar

Do I miss anything? Might be worth mentioning that I use a pre-populated local Maven repository so there's no downloading expected. If that's the reason for the lack of output, it'd still be cool to see which dependencies the launcher is using from where.

Maven plugin properties goal NPE - failure in thin.properties generation - Cannot calculate dependencies for: null

Hi,

Environment:
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Java version: 10.0.1, vendor: Oracle Corporation
Default locale: pl_PL, platform encoding: Cp1250
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

When I try to generate the thin.properties file manually I get the NPE exception.
The plugin console log indicates strange thing that properties are calculated for null.

I kindly ask for support.

[INFO] --- spring-boot-thin-maven-plugin:1.0.12.RELEASE:properties (default-cli) @ salomon-one-pager-generator ---
[INFO] Calculating properties for: null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.043 s
[INFO] Finished at: 2018-08-01T19:50:41+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:1.0.12.RELEASE:properties (default-cli) on project salomon-one-pager-generator: Cannot calculate dependencies for: null: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:1.0.12.RELEASE:properties (default-cli) on project salomon-one-pager-generator: Cannot calculate dependencies for: null
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot calculate dependencies for: null
    at org.springframework.boot.experimental.maven.PropertiesMojo.execute (PropertiesMojo.java:99)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException
    at org.springframework.boot.experimental.maven.PropertiesMojo.boms (PropertiesMojo.java:115)
    at org.springframework.boot.experimental.maven.PropertiesMojo.execute (PropertiesMojo.java:84)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Use authentication configuration for repositories declared in Maven settings via profiles

Authentication information for dedicated repositories in Maven settings seem to be ignored.

Enclosed you'll see an example of our settings:

<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <servers>
        <server>
            <id>internal-releases</id>
            <username>...</username>
            <password>MAVEN_ENCRYPTED_PASSWORD</password>
        </server>
        <server>
            <id>internal-snapshots</id>
            <username>...</username>
            <password>MAVEN_ENCRYPTED_PASSWORD</password>
        </server>
        <server>
            <id>proxy-repositories</id>
            <username>...</username>
            <password>MAVEN_ENCRYPTED_PASSWORD</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <id>proxy-repositories</id>
            <url>https://internal-nexus-proxy-repositories/...</url>
            <mirrorOf>*,!internal-releases,!internal-snapshots</mirrorOf>
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>defaultprofile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>internal-releases</id>
                    <url>https://internal-nexus-releases/...</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                </repository>
                <repository>
                    <id>internal-snapshots</id>
                    <url>https://internal-nexus-snapshots/...</url>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                    </snapshots>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                </repository>
            </repositories>
        </profile>
    </profiles>
</settings>

As soon as we're including some artifacts of the above mentioned internal-releases repository, that requires an authentication, following error occurs...

org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for <groupId>:<artifactId>:<packaging>:<version>
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:282)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
	at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
	at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:126)
	at org.springframework.boot.loader.thin.DependencyResolver.dependencies(DependencyResolver.java:175)
	at org.springframework.boot.loader.thin.DependencyResolver.dependencies(DependencyResolver.java:164)
	at org.springframework.boot.loader.thin.DependencyResolverTests.petclinic(DependencyResolverTests.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact <groupId>:<artifactId>:<packaging>:<version> from/to internal-releases (https://internal-nexus-releases/...): Unauthorized (401)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
	at org.apache.maven.repository.internal.DefaultArtifactResolver.loadPom(DefaultArtifactDescriptorReader.java:267)
	... 39 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact <groupId>:<artifactId>:<packaging>:<version> from/to internal-releases (https://internal-nexus-releases/...): Unauthorized (401)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
	... 42 more
Caused by: org.apache.http.client.HttpResponseException: Unauthorized (401)
	at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:466)
	at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:291)
	at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:243)
	at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
	... 47 more

Some debugging has shown that the artifact repositories doesn't hold any of the configured authentication settings. I hope the description of our problem isn't TLDR and you can reproduce the situation.

Pull request is following...

Problem when jar is located in folder with spaces in the name

I created an installer with install4j which installs service:
<java mainClass="org.springframework.boot.loader.wrapper.ThinJarWrapper" mainMode="1" vmParameters="-Dthin.root=./libs" arguments="" allowVMPassthroughParameters="true" preferredVM="server" bundleRuntime="true"> <classPath> <archive location="libs/manager-server-*.jar" failOnError="true" /> </classPath> <modulePath /> <nativeLibraryDirectories /> </java>

I packed the application with its dependencies.

If I install the application in a folder which name does not contains spaces works without problem but if I install in "Program Files" the app cannot start and the log files contains following exception:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:125)
at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.exe4j.runtime.WinLauncher$2.run(WinLauncher.java:96)
Caused by: java.lang.IllegalArgumentException: File C:\Program%20Files%20(x86)\XXXXX\YYYYY\libs\manager-server-12.0-SNAPSHOT.jar must exist
at org.springframework.boot.loader.data.RandomAccessDataFile.(RandomAccessDataFile.java:68)
at org.springframework.boot.loader.data.RandomAccessDataFile.(RandomAccessDataFile.java:51)
at org.springframework.boot.loader.jar.JarFile.(JarFile.java:83)
at org.springframework.boot.loader.archive.JarFileArchive.(JarFileArchive.java:61)
at org.springframework.boot.loader.archive.JarFileArchive.(JarFileArchive.java:57)
at org.springframework.boot.loader.thin.ArchiveUtils.getArchive(ArchiveUtils.java:55)
at org.springframework.boot.loader.thin.ThinJarLauncher.computeArchive(ThinJarLauncher.java:413)
at org.springframework.boot.loader.thin.ThinJarLauncher.(ThinJarLauncher.java:143)
at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:139)
... 12 more

I'm pretty sure the jar file exists :(
I'm using 1.0.12.RELEASE.
Have you suffered this problem before?

Running build fails at simple

Running build fails at simple:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] tools .............................................. SUCCESS [  4.051 s]
[INFO] Thin Launcher ...................................... SUCCESS [  2.282 s]
[INFO] maven-plugin ....................................... SUCCESS [  4.943 s]
[INFO] Thin Wrapper ....................................... SUCCESS [  0.865 s]
[INFO] Thin Launcher Parent ............................... SUCCESS [  0.073 s]
[INFO] Thin Launcher Gradle ............................... SUCCESS [  0.744 s]
[INFO] capsule-app ........................................ SUCCESS [  8.304 s]
[INFO] app ................................................ SUCCESS [  5.719 s]
[INFO] simple ............................................. FAILURE [  7.676 s]
[INFO] Thin Launcher Samples .............................. SKIPPED
[INFO] Thin Launcher Sample Tests ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.774 s
[INFO] Finished at: 2017-01-19T22:11:08+00:00
[INFO] Final Memory: 99M/668M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot.experimental:spring-boot-thin-maven-plugin:0.0.1.BUILD-SNAPSHOT:resolve (resolve) on project simple: Cannot locate deployable /Users/aliostad/github/spring-boot-thin-launcher/samples/simple/target/simple-0.0.1-SNAPSHOT.jar: Could not exec java: Application finished with exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

And the error seems to be

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:92)
	at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:77)
Caused by: org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException: java.lang.IllegalStateException: Cannot resolve version for org.springframework.cloud:spring-cloud-starter-config:jar: ()
	at org.springframework.boot.loader.thin.AetherEngine.resolveDependencies(AetherEngine.java:236)
	at org.springframework.boot.loader.thin.AetherEngine.resolveTransitive(AetherEngine.java:245)
	at org.springframework.boot.loader.thin.AetherEngine.resolve(AetherEngine.java:186)
	at org.springframework.boot.loader.thin.ArchiveUtils$ArchiveDependencies.resolve(ArchiveUtils.java:411)
	at org.springframework.boot.loader.thin.ArchiveUtils.extract(ArchiveUtils.java:264)
	at org.springframework.boot.loader.thin.ArchiveUtils.combine(ArchiveUtils.java:709)
	at org.springframework.boot.loader.thin.ThinJarLauncher.getClassPathArchives(ThinJarLauncher.java:245)
	at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:139)
	at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:102)
	... 6 more
Caused by: java.lang.IllegalStateException: Cannot resolve version for org.springframework.cloud:spring-cloud-starter-config:jar: ()
	at org.springframework.boot.loader.thin.AetherEngine.getCollectRequest(AetherEngine.java:298)
	at org.springframework.boot.loader.thin.AetherEngine.resolveDependencies(AetherEngine.java:228)

Allow thin.root to be specified in plugin configuration

When we use the resolve goal of the thin plugin it would be nice to be able to specify the thin.root so that it doesn't always point to .

The use case is this:
Suppose we have a number of microservices s1, s2, ... sn.
The libraries for this are placed in a folder called (say) service-dependencies/thin/root/repository.
The maven build puts the dependencies for each service into this service-dependencies folder. Essentially the microservices are part of a bigger system and our maven.repo.local has all other dependencies which I don't want to include with my microservice dependencies. So we end up with a separate repo which contain just the microservice dependencies.

Allowing thin.root to be overridden will allow us to make the plugin write service dependencies to a diff repo.

"hybrid" mode to inline some jars into thin jar

if snapshot jars are not inlined into thin jar, the app could be different after startup because of snapshot jars changed in local maven repository. it's not good for integrated testing and deployment in testing environment. could thin launcher add a configuration to inline some jars?

Running jdeps on the jar

I would like to run jdeps on my spring boot jar, but I assume that this must be run on the fat jar, and not on the thin jar.

Is there any option available, which will generate a fat jar, besides the thin jar? (In which case I could run jdeps on the fat, and deploy the thin.)

Gradle build failing in shadow sample with Boot 2.0 and Gradle 4.8

The changes that were made to support Boot 2.0 appear to be broken. What was supposed to happen:

  1. For a simple one-jar project, the Spring Boot thick jar is omitted and instead a thin jar is built (like what happened in 1.5.x).
  2. For a simple project when the user explicitly configures the Spring Boot thick jar, the result is a thick and a thin executable jar (this is what happens in the "app" sample).
  3. For a project with the shadow plugin, and also applying the Spring Boot plugin, you get 2 jars, one is fat and flat (the shadow one) and the other is thin and executable (the boot one).

What actually happens: 1. and 2. work but 3. is broken (the "shadow" sample). Update the shadow sample to use Boot 2.0 and Gradle 4.8 to see it break:

diff --git a/samples/shadow/build.gradle b/samples/shadow/build.gradle
index 4b0f62c..b402e38 100644
--- a/samples/shadow/build.gradle
+++ b/samples/shadow/build.gradle
@@ -1,6 +1,6 @@
 buildscript {
        ext {
-               springBootVersion = '1.5.1.RELEASE'
+               springBootVersion = '2.0.3.RELEASE'
                wrapperVersion = '1.0.13.BUILD-SNAPSHOT'
         shadowVersion = '2.0.1'
        }
@@ -21,7 +21,8 @@ buildscript {
 apply plugin: 'java'
 apply plugin: 'maven'
 apply plugin: 'eclipse'
-apply plugin: 'spring-boot'
+apply plugin: 'io.spring.dependency-management'
+apply plugin: 'org.springframework.boot'
 apply plugin: 'com.github.johnrengelman.shadow'
 apply plugin: 'org.springframework.boot.experimental.thin-launcher'
 
@@ -30,7 +31,7 @@ version = '0.0.1-SNAPSHOT'
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
-assemble.dependsOn = [shadowJar, bootRepackage]
+assemble.dependsOn = [shadowJar, bootJar]
 
 repositories {
        mavenLocal()
diff --git a/samples/shadow/gradle/wrapper/gradle-wrapper.properties b/samples/shadow/gradle/wrapper/gradle-wrapper.properties
index a0b2851..717f038 100644
--- a/samples/shadow/gradle/wrapper/gradle-wrapper.properties
+++ b/samples/shadow/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip

The result is a "successful" build that does not contain a shaded jar:

$ (cd samples/shadow/; gradle clean build)
$ ls -l samples/shadow/build/libs/
total 96
-rw-rw-r-- 1 dsyer dsyer  2737 Jul  9 15:38 shadow-0.0.1-SNAPSHOT-all.jar
-rw-rw-r-- 1 dsyer dsyer 92625 Jul  9 15:38 shadow-0.0.1-SNAPSHOT.jar

The "all" jar is supposed to be a fat (flat) shaded jar, but it only contains the application classes. The other one is supposed to be an executable thin jar but actually it is a Boot "fat" jar without the BOOT-INF/lib - it is neither one thing nor the other.

The AWS sample in Spring Cloud Function is even more broken because it moans about the fact that a task called "thinJarShadowJar" does not exist. This can be fixed by simply removing the afterEvaluate that asserts its existence. I'll probably do that because it doesn't seem to help anyone.

Create "layered" Docker build from thin launcher

Being inspired from the discussion in spring-projects/spring-boot#1813 I would like to see the following based on thin launcher: Create a Docker build with the following properties

  • Add all dependencies as Docker layers (by separate Docker ADD commands)
  • Add the application jar as the latest Docker layer

As long as only the application changes this should result in

  • a very fast Docker build since all other layers would be already cached
  • an improved shipment of the Docker image (ship dependency layers once, then only ship final application layer on changes)

The idea was also discussed here: https://github.com/JCrete/jcrete2017/tree/master/Day3/Session2/Java-Docker-Alignment and a PR is prepared and on it's way.

Support Spring Boot 2.0 with Gradle

Spring Boot 2.0's Gradle plugin is fundamentally different to 1.x's and, as a result, the Thin Launcher doesn't work with Boot 2.0 (as of 2.0.0.M3). A couple of key differences:

  1. bootRepackage no longer exists and BootJar tasks should be considered instead
  2. Custom layouts are not (currently?) supported with Gradle in Boot 2.0

1 is relatively straightforward once we've figured out how Boot 2.0 support will be provided (alongside 1.x, in a 2.0 version of this plugin, something else?)

2 is trickier. I'm not yet convinced that supporting custom layouts in Gradle is the right thing to do, at least not in their current form. They make a lot of sense in Maven where things aren't as flexible, but in Gradle where BootJar inherits all the capabilities of Gradle's copy task there may be a more idiomatic and powerful way to do it. The downside would be that code sharing across build systems is lost.

Could not customize maven repositories

mavenRepositories fixes maven repositories to local, spring-snapshots and central, I could not find a way to add a new one.

The scenario is that I test spring-boot-thin in a grails project whose default repo is https://repo.grails.org/grails/core, some jars only published to that repo. When running the thin-jar, it reports the following exception:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:112)
        at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:81)
Caused by: java.lang.RuntimeException: Could not find artifact org.grails:grails-gsp:jar:3.3.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails:grails-gsp:jar:3.3.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails:grails-web-gsp:jar:3.3.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails:grails-web-gsp:jar:3.3.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails:grails-web-sitemesh:jar:3.3.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails:grails-web-sitemesh:jar:3.3.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails.plugins:converters:jar:3.3.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails.plugins:converters:jar:3.3.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails.plugins:cache:jar:4.0.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails.plugins:cache:jar:4.0.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails.plugins:hibernate5:jar:6.1.6 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails.plugins:hibernate5:jar:6.1.6 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails.plugins:gsp:jar:3.3.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails.plugins:gsp:jar:3.3.0 in central (https://repo1.maven.org/maven2)
Could not find artifact com.bertramlabs.plugins:asset-pipeline-grails:jar:2.14.2 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact com.bertramlabs.plugins:asset-pipeline-grails:jar:2.14.2 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails:grails-gorm-testing-support:jar:1.0.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails:grails-gorm-testing-support:jar:1.0.0 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails.plugins:geb:jar:1.1.1 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails.plugins:geb:jar:1.1.1 in central (https://repo1.maven.org/maven2)
Could not find artifact org.grails:grails-web-testing-support:jar:1.0.0 in spring-snapshots (https://repo.spring.io/libs-snapshot)
Could not find artifact org.grails:grails-web-testing-support:jar:1.0.0 in central (https://repo1.maven.org/maven2)
        at org.springframework.boot.loader.thin.DependencyResolver.dependencies(DependencyResolver.java:205)
        at org.springframework.boot.loader.thin.PathResolver.extract(PathResolver.java:182)
        at org.springframework.boot.loader.thin.PathResolver.resolve(PathResolver.java:94)
        at org.springframework.boot.loader.thin.ThinJarLauncher.getClassPathArchives(ThinJarLauncher.java:324)
        at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:186)
        at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:139)

I think thin-jar should follow the build.gradle's repositories.

Spring Boot 2.0 apps cannot be launched with Spring Boot 1.x

Not really very surprising this one, and it will probably be closed as "Won't Fix". But this is what happens when you compile with 2.0 and run with 1.x (or vice versa):

Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
	at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:186)
	at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:133)
	... 6 more
Caused by: java.lang.NoSuchMethodError: org.springframework.boot.SpringApplication.run(Ljava/lang/Class;[Ljava/lang/String;)Lorg/springframework/context/ConfigurableApplicationContext;
	at com.example.LauncherApplication.main(LauncherApplication.java:21)
	... 15 more

Support for Spring Boot 2.0 build-info generation in Maven

The Maven plugin from Spring Boot works fine with the thin layout, but not if you use the "build-info" mojo from Spring Boot:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:build-info (default) on project petclinic-latest: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:build-info failed: An API incompatibility was encountered while executing org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:build-info: java.lang.NoSuchMethodError: org.springframework.boot.loader.tools.BuildPropertiesWriter$ProjectDetails.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/time/Instant;Ljava/util/Map;)V

Very large thin/root/repository

Hello

Using this awesome thin launcher, I was able to split my 40 MB uberjar into a 100 kB thin jar and a 70 MB "thin" repository. Wondering were the additional 30 MB came from, I noticed that the launcher

  • includes test scoped dependencies in the repository and
  • spring-boot-thin-launcher-1.0.10.RELEASE-exec.jar is 10 MB fat.

Is there any way to reduce the repository size? This is a problem when iterating changes which affect the repository, because I end up updating an image layer that is larger than the original uber jar.

Add thin.offline option

If a dry run has already been done, it should be possible to shave some time off startup by not doing any network calls to the remote repositories (e.g. DNS can be slow, even if you don't even send HTTP traffic).

Support for multi module project

Works for single project but not on multi module project.
Is there any flag in gradle to package dependent projects instead of downloading in runtime

compile project(':library')

Tried out in https://github.com/spring-guides/gs-multi-module/tree/master/complete and got the below error

java -jar gs-multi-module-application-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
...
Caused by: org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact gs-multi-module:library:jar:unspecified: in central (http://repo1.maven.org/maven2/)

Ability to verify checksum (immutable approach)

As a build engineer,
I want to prove authenticity of artifacts by SHA1 (for computed list, without transitive dependencies),
so that I can give a guarantee to a release manager that the deployment binaries was not changed between stage and production environment.

Support for exploded jars in deployer

The tools should be able to identify an exploded jar with a file: URL. This is mainly relevant to the deployer, which could run an app from such a directory without having any Maven co-ordinates. If Maven co-ordinates are also available (e.g. via a pom.xml) then we might also be able to use it in a classpath of a launched app.

Gradle shadow plugin breaks thin jar plugin

I don't know if this is a bug in the thin plugin, but it probably is. It's probably not a common use case, but if you wanted to build a shaded jar in addition to a thin one (e.g. to deploy to AWS Lambda) it would be useful to be able to use the shadow plugin. Currently as soon as you apply both plugins in one project Gradle barfs before it even runs any build code:

> Failed to apply plugin [id 'org.springframework.boot.experimental.thin-launcher']
   > Cannot add task ':thinProperties' as a task with that name already exists.

Add classpath to --thin.debug=true

The thin launcher's main responsibility is to resolve dependencies to run a Boot app. That means, the actual binary doesn't contain them in the first place. Thus it would be cool if the application could be run and the resolved dependencies were logged prior to the actual application's run.

A couple of options to see the classpath already exist, with a couple of downsides:

  • --thin.classpath — doesn't run the app
  • -Ddebug — switches on Boot's debug mode which actually lists the classpath but also enables verbose output for the entire app (autoconfiguration report etc.) which might be too verbose for a production run

It would be cool if -Dthin.debug included the calculated classpath (essentially what --thin.classpath outputs but maybe a single line per dependency for easier grep-ing?).

Read repositories from active profiles in Maven settings

In my company we're configuring the internal Maven repositories via profiles in the Maven settings. Currently these settings seems to be completely ignored by the thin-launcher (1.0.3.RELEASE). It's just working if we add the internal repositories to the projects POM.

The thin-launchers Maven settings encapsulation class org.springframework.boot.loader.thin.MavenSettings holds the information about the active profiles, but we don't see any usage of it by the launcher.

Or do we just have to RTFM again :-)?

Support for using Spring Boot without the parent POM

When i'm using Maven's dependency management import (as described in https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent), instead of including the parent POM spring-boot-starter-parent, the application launch fails with following error:

no main manifest attribute, in whatever.jar

MANIFEST.MF of a working thin jar, which is using the parent POM:

Manifest-Version: 1.0
Implementation-Title: whatever
Implementation-Version: 0.0.1-SNAPSHOT
Archiver-Version: Plexus Archiver
Built-By: whoever
Implementation-Vendor-Id: com.example
Spring-Boot-Version: null
Implementation-Vendor: Pivotal Software, Inc.
Main-Class: org.springframework.boot.loader.wrapper.ThinJarWrapper
Start-Class: com.example.SpringBootApplication
Spring-Boot-Classes: 
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_141
Implementation-URL: http://projects.spring.io/spring-boot/whatever/

MANIFEST.MF of a broken thin jar, which is using the dependency management import:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: whoever
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_141

Proxy settings provided in settings.xml are not used during download

My settings.xml is basic :

<settings>
  <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>172.26.132.8</host>
      <port>3128</port>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

Then I run :

java -Dthin.profile=exclude_Shared -Dthin.classpath=path -Dthin.root=. -jar MyJar.jar --thin.dryrun

and I get :

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:118)
        at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:90)
Caused by: java.lang.IllegalStateException: hidden.org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: ch.qos.logback:logback-core:jar:1.1.11, ch.qos.logback:logback-classic:jar:1.1.11, com.google.code.findbugs:annotations:jar:3.0.1, org.springframework.kafka:spring-kafka:jar:1.3.0.RELEASE, org.springframework:spring-expression:jar:4.3.11.RELEASE, org.springframework:spring-context:jar:4.3.11.RELEASE, org.freemarker:freemarker:jar:2.3.26-incubating, net.jcip:jcip-annotations:jar:1.0, com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0, org.springframework.security:spring-security-core:jar:4.2.3.RELEASE, org.slf4j:jul-to-slf4j:jar:1.7.25, org.springframework:spring-tx:jar:4.3.11.RELEASE, com.fasterxml.jackson.core:jackson-databind:jar:2.8.10, org.slf4j:slf4j-api:jar:1.7.25, org.springframework:spring-web:jar:4.3.11.RELEASE, org.springframework.security:spring-security-config:jar:4.2.3.RELEASE, org.yaml:snakeyaml:jar:1.17, com.sun.mail:dsn:jar:1.5.6, javax.activation:activation:jar:1.1.1, org.springframework:spring-context-support:jar:4.3.11.RELEASE, org.springframework:spring-core:jar:4.3.11.RELEASE, org.springframework:spring-aop:jar:4.3.11.RELEASE, org.slf4j:jcl-over-slf4j:jar:1.7.25, io.jsonwebtoken:jjwt:jar:0.9.0, com.sun.mail:javax.mail:jar:1.5.6, org.springframework.boot:spring-boot-autoconfigure:jar:1.5.7.RELEASE, org.apache.kafka:kafka-clients:jar:0.11.0.1, org.springframework:spring-beans:jar:4.3.11.RELEASE, com.google.code.findbugs:jsr305:jar:3.0.2, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.10, org.slf4j:log4j-over-slf4j:jar:1.7.25, org.springframework.retry:spring-retry:jar:1.2.1.RELEASE, org.jooq:jool:jar:0.9.12, org.springframework.boot:spring-boot-starter-logging:jar:1.5.7.RELEASE, org.springframework.boot:spring-boot-starter:jar:1.5.7.RELEASE, com.fasterxml.jackson.core:jackson-core:jar:2.8.10, net.jpountz.lz4:lz4:jar:1.3.0, org.springframework.security:spring-security-web:jar:4.2.3.RELEASE, org.springframework.boot:spring-boot-starter-security:jar:1.5.7.RELEASE, org.springframework:spring-messaging:jar:4.3.11.RELEASE, org.springframework.boot:spring-boot-starter-mail:jar:1.5.7.RELEASE, com.google.guava:guava:jar:20.0, org.xerial.snappy:snappy-java:jar:1.1.2.6, org.springframework.boot:spring-boot:jar:1.5.7.RELEASE, io.netty:netty-all:jar:4.1.4.Final: Could not transfer artifact ch.qos.logback:logback-core:jar:1.1.11 from/to spring-snapshots (https://repo.spring.io/libs-snapshot): connect timed out
        at org.springframework.boot.loader.thin.DependencyResolver.collectNonTransitive(DependencyResolver.java:494)
        at org.springframework.boot.loader.thin.DependencyResolver.aetherDependencies(DependencyResolver.java:234)
        at org.springframework.boot.loader.thin.DependencyResolver.dependencies(DependencyResolver.java:182)
        at org.springframework.boot.loader.thin.PathResolver.extract(PathResolver.java:182)
        at org.springframework.boot.loader.thin.PathResolver.resolve(PathResolver.java:94)
        at org.springframework.boot.loader.thin.ThinJarLauncher.getClassPathArchives(ThinJarLauncher.java:320)
        at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:169)
        at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:133)
        ... 6 more
Caused by: hidden.org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: ch.qos.logback:logback-core:jar:1.1.11, ch.qos.logback:logback-classic:jar:1.1.11, com.google.code.findbugs:annotations:jar:3.0.1, org.springframework.kafka:spring-kafka:jar:1.3.0.RELEASE, org.springframework:spring-expression:jar:4.3.11.RELEASE, org.springframework:spring-context:jar:4.3.11.RELEASE, org.freemarker:freemarker:jar:2.3.26-incubating, net.jcip:jcip-annotations:jar:1.0, com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0, org.springframework.security:spring-security-core:jar:4.2.3.RELEASE, org.slf4j:jul-to-slf4j:jar:1.7.25, org.springframework:spring-tx:jar:4.3.11.RELEASE, com.fasterxml.jackson.core:jackson-databind:jar:2.8.10, org.slf4j:slf4j-api:jar:1.7.25, org.springframework:spring-web:jar:4.3.11.RELEASE, org.springframework.security:spring-security-config:jar:4.2.3.RELEASE, org.yaml:snakeyaml:jar:1.17, com.sun.mail:dsn:jar:1.5.6, javax.activation:activation:jar:1.1.1, org.springframework:spring-context-support:jar:4.3.11.RELEASE, org.springframework:spring-core:jar:4.3.11.RELEASE, org.springframework:spring-aop:jar:4.3.11.RELEASE, org.slf4j:jcl-over-slf4j:jar:1.7.25, io.jsonwebtoken:jjwt:jar:0.9.0, com.sun.mail:javax.mail:jar:1.5.6, org.springframework.boot:spring-boot-autoconfigure:jar:1.5.7.RELEASE, org.apache.kafka:kafka-clients:jar:0.11.0.1, org.springframework:spring-beans:jar:4.3.11.RELEASE, com.google.code.findbugs:jsr305:jar:3.0.2, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.10, org.slf4j:log4j-over-slf4j:jar:1.7.25, org.springframework.retry:spring-retry:jar:1.2.1.RELEASE, org.jooq:jool:jar:0.9.12, org.springframework.boot:spring-boot-starter-logging:jar:1.5.7.RELEASE, org.springframework.boot:spring-boot-starter:jar:1.5.7.RELEASE, com.fasterxml.jackson.core:jackson-core:jar:2.8.10, net.jpountz.lz4:lz4:jar:1.3.0, org.springframework.security:spring-security-web:jar:4.2.3.RELEASE, org.springframework.boot:spring-boot-starter-security:jar:1.5.7.RELEASE, org.springframework:spring-messaging:jar:4.3.11.RELEASE, org.springframework.boot:spring-boot-starter-mail:jar:1.5.7.RELEASE, com.google.guava:guava:jar:20.0, org.xerial.snappy:snappy-java:jar:1.1.2.6, org.springframework.boot:spring-boot:jar:1.5.7.RELEASE, io.netty:netty-all:jar:4.1.4.Final: Could not transfer artifact ch.qos.logback:logback-core:jar:1.1.11 from/to spring-snapshots (https://repo.spring.io/libs-snapshot): connect timed out
        at hidden.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
        at hidden.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
        at hidden.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:302)
        at org.springframework.boot.loader.thin.DependencyResolver.collectNonTransitive(DependencyResolver.java:490)
        ... 13 more
Caused by: hidden.org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact ch.qos.logback:logback-core:jar:1.1.11 from/to spring-snapshots (https://repo.spring.io/libs-snapshot): connect timed out
        at hidden.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
        at hidden.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
        at hidden.org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:542)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
        at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:164)
        at hidden.org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:287)
        at hidden.org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:243)
        at hidden.org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59)
        at hidden.org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
        at hidden.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
        ... 4 more

This is my analysis :

In lines 125 & 138 of https://github.com/eclipse/aether-core/blob/4cf5f7a406b516a45d8bf15e7dfe3fb3849cb87b/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java#L125
we can see httpclient proxy is configured from RemoteRepository.proxy

And from https://github.com/dsyer/spring-boot-thin-launcher/blob/561d2e4b8a17addfbba75d4bfca36f4dd3cde4f8/launcher/src/main/java/org/springframework/boot/loader/thin/DependencyResolver.java#L359
we can see builder is not invoking setProxy method (https://github.com/eclipse/aether-core/blob/4cf5f7a406b516a45d8bf15e7dfe3fb3849cb87b/aether-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java#L472)

in conjunction of https://github.com/dsyer/spring-boot-thin-launcher/blob/561d2e4b8a17addfbba75d4bfca36f4dd3cde4f8/launcher/src/main/java/org/springframework/boot/loader/thin/MavenSettings.java#L255

Thank you for taking time to see whether my analysis is good.

Use maven.repo.local system property if set

The user already has the option to set maven.home (not documented but quite explicit in code), but the usual Maven command line flag of maven.repo.local doesn't work. As a courtesy, and to support standard Maven idioms in the maven plugin, we should support it in the launcher.

Not downloading dependencies to thin.root if thin.properties is computed

Hello,

I'm writing an article on the Spring Boot Thin Launcher and thus I'm trying various configurations with Maven and Gradle. I've started from an existing Boot with Gradle project which I did not write myself, whose build.gradle is located at https://github.com/eugenp/tutorials/blob/master/spring-boot-gradle/build.gradle.

Compared to it, the file I'm working on only adds the thin launcher plugin and the Maven plugin.

If I run gradlew thinResolve, I get a build/thin/root/repository directory full of dependencies, as expected.

However, if I add the line:
bootJar.dependsOn = [thinProperties]
to the end of my build.gradle, gradlew thinResolve produces a build/thin/root/repository directory containing only the thin launcher itself and no other dependencies.

In either case, the thin jar works fine (the application starts). However, when it contains the thin.properties file, if I run the app with java -jar build/libs/demo-0.0.1-SNAPSHOT.jar --thin.root=foo, then the foo/repository directory again only contains the launcher, whereas if the jar is built without a thin.properties then the foo/repository is populated as I expect.

Is this a bug?

Change group ID

To avoid any confusion with existing Spring Boot modules could the groupId be changed to something like org.springframework.boot.experimental.launcher?

Cannot resolve dependency with version property

I encounter the following error

[ERROR] 'build.plugins.plugin[org.springframework.boot:spring-boot-maven-plugin].dependencies.dependency.version' for org.springframework.boot.experimental:spring-boot-thin-layout:jar must be a valid version but is '${spring-boot-thin-maven-plugin.version}'. @ org.dukecon:dukecon-server-springboot:[unknown-version], URL [jar:file:/Users/ascheman/wrk/dukecon/dukecon_server/impl/target/dukecon-server-springboot-1.4-SNAPSHOT.jar!/META-INF/maven/org.dukecon/dukecon-server-springboot/pom.xml], line 669, column 22

The POM contains the following block (lines 660 - 671)

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.springframework.boot.experimental</groupId>
            <artifactId>spring-boot-thin-layout</artifactId>
            <!-- For some reason spring-boot-thin-maven-plugin or the embedded artifact resolver cannot use a version property here -->
            <!--<version>1.0.7.BUILD-SNAPSHOT</version>-->
            <version>${spring-boot-thin-maven-plugin.version}</version>
          </dependency>
        </dependencies>

As you can see from the comment everything is fine if I replace the version property with a real value.

Add support for creating a fat-jar out of a thin-jar

In scenarios where one has access to an m2 repo or can upload co-located dependencies
it is easy to use the thin jar approach.

However in restricted environments a fatjar is more appropriate. In such cases it would be
very convenient to be able to create a fatjar from a given thin jar.

Perhaps something like this would do the trick:

java -jar thin.jar -Dthin.supersizeme=./fat.jar

Use a Gradle-generated pom rather than thin.properties

You can get Gradle to generate a pom for you as long as the maven plugin has been applied.

Here's an example that also gets the dependency management plugin to configure the generated pom with any dependency management that's been configured:

task createPom {
    doLast {
        pom {
            withXml(dependencyManagement.pomConfigurer)
        }.writeTo('build/pom.xml')
    }
}

I think this might be preferable to supporting thin.properties.

README out of date.

Hi, this is a wonderful idea to keep the artefact as small as possible. Unfortunately the documentation in the README seems to be not up to date. The instructions on how to configure Maven ends in a failed build. And it seems that module-layout is not supported anymore?
Furthermore a properties file 'thin.properties' is mentioned multiple times. But I cant find such a properties file generated in the jars build. Maybe this could be clarified?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.