private static String formatMessage( String projectId, String locationInPom, String offendingVersion, InvalidVersionSpecificationException cause ) { return "Invalid version: " + offendingVersion + " found for: " + locationInPom + " in project: " + projectId + ". Reason: " + cause.getMessage(); }
+ e.getMessage() );
"': " + e.getMessage(), e );
private Artifact createDependencyArtifact( Dependency dependency, Artifact owner, Artifact pom ) throws ArtifactMetadataRetrievalException { try { String inheritedScope = ( owner != null ) ? owner.getScope() : null; ArtifactFilter inheritedFilter = ( owner != null ) ? owner.getDependencyFilter() : null; return createDependencyArtifact( repositorySystem, dependency, inheritedScope, inheritedFilter ); } catch ( InvalidVersionSpecificationException e ) { throw new ArtifactMetadataRetrievalException( "Invalid version for dependency " + dependency.getManagementKey() + ": " + e.getMessage(), e, pom ); } }
"' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e );
"' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e );
/** * Checks whether the currently running Maven satisfies the specified version (range). * * @param version The version range to test for, must not be <code>null</code>. * @return <code>true</code> if the current Maven version matches the specified version range, <code>false</code> * otherwise. */ protected boolean isMavenVersion( String version ) { try { VersionRange versionRange = VersionRange.createFromVersionSpec( version ); ArtifactVersion mavenVersion = runtimeInformation.getApplicationVersion(); return versionRange.containsVersion( mavenVersion ); } catch ( InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( e.getMessage() ); } }
/** * Try to find the dependency artifact that matches the given dependency. * * @param dependency * @return * @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; }
/** * Try to find the dependency artifact that matches the given dependency. * * @param dependency * @return * @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; }
+ "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e );
protected Map createManagedVersionMap(String projectId, DependencyManagement dependencyManagement) throws ProjectBuildingException { Map 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.EMPTY_MAP; } return map; }
throw new ProjectBuildingException(project.getId(), "Unable to parse version '" + d.getVersion() + "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e);
/** * * @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; }
protected Map createManagedVersionMap(String projectId, DependencyManagement dependencyManagement) throws ProjectBuildingException { Map 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.EMPTY_MAP; } return map; }
throw new ProjectBuildingException(project.getId(), "Unable to parse version '" + d.getVersion() + "' for dependency '" + d.getManagementKey() + "': " + e.getMessage(), e);
"AbstractIdeSupportMojo.unabletoparseversion", new Object[]{ //$NON-NLS-1$ projectId, d.getVersion(), d.getManagementKey(), e.getMessage()}), e);
versionRange = VersionRange.createFromVersionSpec(mavenParameters.getVersionRangeWithProjectVersion()); } catch (InvalidVersionSpecificationException e) { throw new MojoFailureException("Invalid version versionRange: " + e.getMessage(), e);