public Map getPluginArtifactMap() { if ( pluginArtifactMap == null ) { pluginArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getPluginArtifacts() ); } return pluginArtifactMap; }
public Map<String, Artifact> getPluginArtifactMap() { if ( pluginArtifactMap == null ) { pluginArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getPluginArtifacts() ); } return pluginArtifactMap; }
if ( project.getPluginArtifacts() != null ) setPluginArtifacts( Collections.unmodifiableSet( project.getPluginArtifacts() ) );
if ( project.getPluginArtifacts() != null ) setPluginArtifacts( Collections.unmodifiableSet( project.getPluginArtifacts() ) );
@Override protected Set<Artifact> getDependenciesToCheck( MavenProject project ) { return project.getPluginArtifacts(); }
@SuppressWarnings( "unchecked" ) protected Set<Artifact> getDependenciesToCheck( MavenProject project ) { return project.getPluginArtifacts(); }
public Set<Artifact> getPluginArtifacts() { return wrapped.getPluginArtifacts(); }
private boolean projectContainsPluginArtifact(String artifactId) { for (Object artifact : project.getPluginArtifacts()) { if (((Artifact) artifact).getArtifactId().contains(artifactId)) { return true; } } return false; }
@Nonnull private Set<String> getThirdPartyPlugins( @Nonnull final List<MavenProject> projects ) { final Set<String> thirdPartyPlugins = new HashSet<>(); for( final MavenProject project : projects ) { for( final org.apache.maven.artifact.Artifact pluginArtifact : project.getPluginArtifacts() ) { final String groupId = pluginArtifact.getGroupId(); final String version = pluginArtifact.getVersion(); if( groupId.startsWith("org.projectlombok") ) { thirdPartyPlugins.add(groupId + ":" + version); } } } return thirdPartyPlugins; }
public Set getPluginArtifacts() { return getDelegate().getPluginArtifacts(); }
@Nonnull private Set<String> getSdkPlugins( @Nonnull final List<MavenProject> projects ) { final Set<String> sdkPlugins = new HashSet<>(); for( final MavenProject project : projects ) { for( final org.apache.maven.artifact.Artifact pluginArtifact : project.getPluginArtifacts() ) { final String groupId = pluginArtifact.getGroupId(); final String artifactId = pluginArtifact.getArtifactId(); final String version = pluginArtifact.getVersion(); if( groupId.startsWith(S4SDK_GROUP_ID_PREFIX) ) { sdkPlugins.add(shortenQualifier(groupId + ":" + artifactId + ":" + version)); } } } return sdkPlugins; }
private Set<String> getSnapshotPluginDeps() { Set<String> snapshotPluginDeps = new HashSet<>(); for (Artifact plugin : project.getPluginArtifacts()) { if (plugin.isSnapshot()) { if (allowGitflowPluginSnapshot && plugin.getGroupId().equals("com.e-gineering") && plugin.getArtifactId().equals("gitflow-helper-maven-plugin")) { getLog().warn("SNAPSHOT com.e-gineering:gitflow-helper-maven-plugin detected. Allowing for this build."); continue; } getLog().debug("SNAPSHOT plugin dependency found: " + plugin.toString()); snapshotPluginDeps.add(plugin.toString()); } } return snapshotPluginDeps; } }
public static File getSdk(MavenProject project, RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository>... repos) throws MojoExecutionException { Artifact artifact = find(project.getPluginArtifacts(), new Predicate<Artifact>() { @Override public boolean apply(Artifact artifact1) { return artifact1.getArtifactId().equals("gcloud-maven-plugin"); } }); String version = artifact.getVersion(); if (version.endsWith("-SNAPSHOT")) { String newestVersion = determineNewestVersion(repoSystem, repoSession, repos); return getSdk(newestVersion, repoSystem, repoSession, repos); } return getSdk("1.9.46", repoSystem, repoSession, repos); }
protected List<Artifact> prepareArtifacts() { List<Artifact> result = new ArrayList<Artifact>(); List<String> siblings = new ArrayList<String>(); for (Object o : reactorProjects) { MavenProject m = (MavenProject) o; siblings.add(getArtifactId(m.getArtifact())); } // treate classic dependencies for (Object o : project.getArtifacts()) { Artifact a = (Artifact) o; Artifact artifact = acceptArtifact(a, siblings); if (artifact != null) { result.add(a); } } // treate also plugin dependencies for (Object o : project.getPluginArtifacts()) { Artifact a = (Artifact) o; Artifact artifact = acceptArtifact(a, siblings); if (artifact != null) { result.add(a); } } return result; }
public static File getSdk(MavenProject project, RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository>... repos) throws MojoExecutionException { Artifact artifact = find(project.getPluginArtifacts(), new Predicate<Artifact>() { @Override public boolean apply(Artifact artifact1) { return artifact1.getArtifactId().equals("gcloud-maven-plugin"); } }); String version = artifact.getVersion(); if (version.endsWith("-SNAPSHOT")) { String newestVersion = determineNewestVersion(repoSystem, repoSession, repos); return getSdk(newestVersion, repoSystem, repoSession, repos); } return getSdk("1.9.42", repoSystem, repoSession, repos); }
@SuppressWarnings("unchecked") public static File getSdk(MavenProject project, RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository>... repos) throws MojoExecutionException { Artifact artifact = find(project.getPluginArtifacts(), new Predicate<Artifact>() { @Override public boolean apply(Artifact artifact1) { return artifact1.getArtifactId().equals("appengine-maven-plugin"); } }); String version = artifact.getVersion(); if (version.endsWith("-SNAPSHOT")) { String newestVersion = determineNewestVersion(repoSystem, repoSession, repos); return getSdk(newestVersion, repoSystem, repoSession, repos); } return getSdk(version, repoSystem, repoSession, repos); }
public static void log( MavenProject project, String where ) { if( disabled ) return; log.debug( "MavenProject ({}) artifacts @ {}:", project.getId(), where); logArtifactContents( "artifacts", project.getArtifacts() ); logArtifactContents( "attachedArtifacts", project.getAttachedArtifacts() ); logArtifactContents( "dependencyArtifacts", project.getDependencyArtifacts() ); logArtifactContents( "extensionArtifacts", project.getExtensionArtifacts() ); logArtifactContents( "pluginArtifacts", project.getPluginArtifacts() ); for( Artifact artifact : project.getPluginArtifacts() ) { if (artifact instanceof PluginArtifact) { List<Dependency> dependencies = ((PluginArtifact) artifact).getDependencies(); Integer maybeSize = (dependencies == null ? null : dependencies.size()); log.debug( " {} " + "pluginDependencies" + ": {}", maybeSize, dependencies ); } } }
public static void log( MavenProject project, String where ) { if( disabled ) return; log.debug( "MavenProject ({}) artifacts @ {}:", project.getId(), where); logArtifactContents( "artifacts", project.getArtifacts() ); logArtifactContents( "attachedArtifacts", project.getAttachedArtifacts() ); logArtifactContents( "dependencyArtifacts", project.getDependencyArtifacts() ); logArtifactContents( "extensionArtifacts", project.getExtensionArtifacts() ); logArtifactContents( "pluginArtifacts", project.getPluginArtifacts() ); for( Artifact artifact : project.getPluginArtifacts() ) { if (artifact instanceof PluginArtifact) { List<Dependency> dependencies = ((PluginArtifact) artifact).getDependencies(); Integer maybeSize = (dependencies == null ? null : dependencies.size()); log.debug( " {} " + "pluginDependencies" + ": {}", maybeSize, dependencies ); } } }
public static void log( MavenProject project, String where ) { if( disabled ) return; log.debug( "MavenProject ({}) artifacts @ {}:", project.getId(), where); logArtifactContents( "artifacts", project.getArtifacts() ); logArtifactContents( "attachedArtifacts", project.getAttachedArtifacts() ); logArtifactContents( "dependencyArtifacts", project.getDependencyArtifacts() ); logArtifactContents( "extensionArtifacts", project.getExtensionArtifacts() ); logArtifactContents( "pluginArtifacts", project.getPluginArtifacts() ); for( Artifact artifact : project.getPluginArtifacts() ) { if (artifact instanceof PluginArtifact) { List<Dependency> dependencies = ((PluginArtifact) artifact).getDependencies(); Integer maybeSize = (dependencies == null ? null : dependencies.size()); log.debug( " {} " + "pluginDependencies" + ": {}", maybeSize, dependencies ); } } }
private MavenProject getPluginProject() throws ProjectBuildingException { final Artifact pluginArtifact = findArtifact(this.project.getPluginArtifacts(), "org.grails", "grails-maven-plugin"); DefaultProjectBuildingRequest request = new DefaultProjectBuildingRequest(); request.setLocalRepository(localRepository) .setRemoteRepositories(project.getRemoteArtifactRepositories()) .setPluginArtifactRepositories(project.getPluginArtifactRepositories()) .setRepositoryMerging(ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT); return projectBuilder.build(pluginArtifact, request).getProject(); }