Projects
home:Eustace:branches:Eulaceura:Factory
shrinkwrap-resolver
_service:obs_scm:shrinkwrap-resolver-2.2.2-mave...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:shrinkwrap-resolver-2.2.2-maven-model3.4.patch of Package shrinkwrap-resolver
diff -Nru resolver-2.2.2/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/internal/MavenModelResolver.java resolver-2.2.2.maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/internal/MavenModelResolver.java --- resolver-2.2.2/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/internal/MavenModelResolver.java 2016-02-10 15:23:47.000000000 +0100 +++ resolver-2.2.2.maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/internal/MavenModelResolver.java 2016-08-09 16:37:49.946612710 +0200 @@ -22,6 +22,7 @@ import java.util.List; import java.util.Set; +import org.apache.maven.model.Dependency; import org.apache.maven.model.Parent; import org.apache.maven.model.Repository; import org.apache.maven.model.building.FileModelSource; @@ -182,6 +183,43 @@ } @Override + public ModelSource resolveModel(Dependency dependency) throws UnresolvableModelException { + Artifact artifact = new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), "", + "pom", dependency.getVersion() ); + + VersionRangeRequest versionRangeRequest = new VersionRangeRequest(artifact, repositories, null); + + try { + VersionRangeResult versionRangeResult = + system.resolveVersionRange(session, versionRangeRequest); + + if (versionRangeResult.getHighestVersion() == null) { + throw new UnresolvableModelException("No versions matched the dependency requested range '" + dependency.getVersion() + + "'", dependency.getGroupId(), dependency.getArtifactId(), + dependency.getVersion()); + + } + + if (versionRangeResult.getVersionConstraint() != null + && versionRangeResult.getVersionConstraint().getRange() != null + && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null) { + throw new UnresolvableModelException("The requested dependency version range '" + dependency.getVersion() + + "' does not specify an upper bound", dependency.getGroupId(), + dependency.getArtifactId(), dependency.getVersion()); + + } + + dependency.setVersion(versionRangeResult.getHighestVersion().toString()); + } catch (VersionRangeResolutionException e) { + throw new UnresolvableModelException(e.getMessage(), dependency.getGroupId(), dependency.getArtifactId(), + dependency.getVersion(), e); + } + + return resolveModel(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion()); + + } + + @Override public void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException { if (session.isIgnoreArtifactDescriptorRepositories()) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2