Java Code Examples for org.apache.maven.artifact.versioning.InvalidVersionSpecificationException#getMessage()
The following examples show how to use
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException#getMessage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfluenceDeployMojo.java From maven-confluence-plugin with Apache License 2.0 | 6 votes |
/** * * @param projectId * @param dependencyManagement * @return * @throws ProjectBuildingException */ private Map<String,Artifact> createManagedVersionMap(String projectId, DependencyManagement dependencyManagement) throws ProjectBuildingException { Map<String,Artifact> map; if (dependencyManagement != null && dependencyManagement.getDependencies() != null) { map = new HashMap<>(); for (Dependency d : dependencyManagement.getDependencies()) { try { VersionRange versionRange = VersionRange.createFromVersionSpec(d.getVersion()); Artifact artifact = factory.createDependencyArtifact(d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), d.getClassifier(), d.getScope()); map.put(d.getManagementKey(), artifact); } catch (InvalidVersionSpecificationException e) { throw new ProjectBuildingException(projectId, "Unable to parse version '" + d.getVersion() + "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e); } } } else { map = Collections.emptyMap(); } return map; }
Example 2
Source File: AbstractVersionsDependencyUpdaterMojo.java From versions-maven-plugin with Apache License 2.0 | 6 votes |
/** * Try to find the dependency artifact that matches the given dependency. * * @param dependency Dependency * @throws MojoExecutionException Mojo execution exception * @return Artifact * @since 1.0-alpha-3 */ protected Artifact toArtifact( Dependency dependency ) throws MojoExecutionException { Artifact artifact = findArtifact( dependency ); if ( artifact == null ) { try { return getHelper().createDependencyArtifact( dependency ); } catch ( InvalidVersionSpecificationException e ) { throw new MojoExecutionException( e.getMessage(), e ); } } return artifact; }
Example 3
Source File: FlattenModelResolver.java From flatten-maven-plugin with Apache License 2.0 | 5 votes |
private static boolean isRestrictedVersionRange( String version, String groupId, String artifactId ) throws UnresolvableModelException { try { return VersionRange.createFromVersionSpec( version ).hasRestrictions(); } catch ( InvalidVersionSpecificationException e ) { throw new UnresolvableModelException( e.getMessage(), groupId, artifactId, version, e ); } }