Comments (6)
I was never really sure if Maven profiles from settings would be helpful for launching an app, so we didn't apply the profiles. What is the use case exactly?
from spring-boot-thin-launcher.
The Maven settings profiles allows us to transparently switch between the companies internal an external development, without providing the repos in some parent POMs or in the projects POM itself. Internally we have to get around with some nasty corporate proxy restrictions, which are bypassed via Maven Nexus proxies or caches, which doesn't matter and also do not work if somebody is developing from outside the company. Then you can include all the fine repositories directly from the internet without problems, while the poor corporate developers have to fight against the corporate proxy. That's why we're handling the repositories implicitly via the Maven settings and leave the projects POM free of our two class development problems.
from spring-boot-thin-launcher.
Thanks for the detail. Just to clarify: you have a profile in your pom.xml that defines repositories, and then you use settings.xml to switch that on? Why don't you just put the repositories in the settings.xml?
from spring-boot-thin-launcher.
Please try a snapshot when you get a chance.
from spring-boot-thin-launcher.
Hi Dave, today I had the chance to test the current snapshot version. The launcher is requesting the correct internal repositories, defined in the Maven settings. But now we're getting an unauthorized status (401) from the internal repos. That's happening because the launcher doesn't seem to set the authentication according to the relevant repository. To return to your previous question: We're already configuring all the repository settings to the Maven settings, as you've suggested.
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.
from spring-boot-thin-launcher.
Please open another issue specifically about authentication. I thought it was working, but it could be we need to add another setting. PR also welcome of course.
from spring-boot-thin-launcher.
Related Issues (20)
- Gradle 7.2: A problem was found with the configuration of task ':thinPom' (type 'PomTask'). HOT 1
- Remote repository credentials not used HOT 4
- Gradle thinProperties task failing on Gradle 7.3 HOT 1
- spring-boot-maven-plugin:2.6.0 causing errors with version 1.0.27.RELEASE HOT 1
- multi module sample run failed
- How to use this when my application libraries directory is not maven repository format
- Can not download full file when using -Dthin.repo="http://maven.aliyun.com/nexus/content/groups/public/" HOT 2
- sample need update. HOT 2
- Default Repository currently not working. Change default thin.repo to maven central, if this isn't just temporary? HOT 1
- Gradle build failing with gradle-8.1, same is wrking with 7.6.1 HOT 4
- config in subprojects with error Cannot run Project.afterEvaluate(Action) when the project is already evaluated. HOT 2
- Spring boot thin launcher jar not found HOT 2
- Cannot locate launcher: /root/.m2/repository/.../spring-boot-thin-launcher-1.0.27.RELEASE-exec.jar HOT 1
- Write a thin jar into a shell script, then run it failed! HOT 5
- spring-boot-thin-maven-plugin doesn't work with my maven nexus setup HOT 1
- I use a custom dependency package through maven and use a relative path. Thin-launcher reports an error and tells me must specify an absolute path. Is there any solution? HOT 1
- The option thin.libs puts jars at the end of the classpath instead of the front HOT 1
- When the META-INF/thin.properties file is present, authenticated/internal maven repositories do not work. HOT 1
- Project does not build HOT 2
- Location of settings.xml is inconsistent with docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-thin-launcher.