[
https://issues.redhat.com/browse/SHRINKRES-282?page=com.atlassian.jira.pl...
]
Max Andersen commented on SHRINKRES-282:
----------------------------------------
I had the same need for jbang to be able to add one or more pom's to avoid having to
specify versions but just rely on the <dependencyManagement> section.
My current workaround is to patch shrinkwrap to at least temporarily allow downloading bom
pom's - see
https://github.com/shrinkwrap/resolver/compare/master...jbangdev:allowpom
with that code I can do the following:
{{
System.setProperty("jbang-allowpom", "true"); // big hack to trick
shrinkwrap in actually get pom
// location
MavenStrategyStage resolve = resolver.resolve(mc.toCanonicalForm());
pomResolve = resolver.loadPomFromFile(resolve.withoutTransitivity().asSingleFile());
System.getProperties().remove("jbang-allowpom");
}}
what is weird is that when doing loadPomFromFile the session does get the
dependencymanagement entries added but if you resolve against resolver those are ignored -
dependencyManagement is *only* done if you loadPomFromFile or classpath first. That seems
to be too restrictive.
So there are two issues IMO:\
1) for some reason shrinkwrap resolve leaves out forcefully any pom dependencies so you
can't even fetch it if you wanted to
2) there should be a way to add to dependency management (i.e. using import scope) and
then have additional resolve methods use that.
Resolve just a pom.xml
----------------------
Key: SHRINKRES-282
URL:
https://issues.redhat.com/browse/SHRINKRES-282
Project: ShrinkWrap Resolvers
Issue Type: Bug
Affects Versions: 2.2.6
Reporter: Paolo Antinori
Priority: Major
What's the correct way to resolve a pom.xml ? My use case is to obtain a BOM.
{code}
Maven.resolver().resolve("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:pom:3.0.0-beta-2").withoutTransitivity().asFile();
{code}
{code}
MavenResolvedArtifact artifact =
Maven.resolver().resolve("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-bom:pom:3.0.0-beta-2").withoutTransitivity()
.asSingle(MavenResolvedArtifact.class);
{code}
they both fail? Am I doing something wrong or is this behavior broken for pom files?
--
This message was sent by Atlassian Jira
(v8.13.1#813001)