com.sun.source.tree.ArrayTypeTree#org.apache.maven.artifact.Artifact源码实例Demo

下面列出了com.sun.source.tree.ArrayTypeTree#org.apache.maven.artifact.Artifact 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

protected JavaFXRunMojo getJavaFXRunMojo(String parent) throws Exception {
    File testPom = new File(getBasedir(), parent + "/pom.xml");
    JavaFXRunMojo mojo = (JavaFXRunMojo) lookupMojo("run", testPom);
    assertNotNull(mojo);

    setUpProject(testPom, mojo);
    MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
    assertNotNull(project);

    if (! project.getDependencies().isEmpty()) {
        final MavenArtifactResolver resolver = new MavenArtifactResolver(project.getRepositories());
        Set<Artifact> artifacts = project.getDependencies().stream()
                .map(d -> new DefaultArtifact(d.getGroupId(), d.getArtifactId(), d.getClassifier(), d.getType(), d.getVersion()))
                .flatMap(a -> resolver.resolve(a).stream())
                .collect(Collectors.toSet());
        if (artifacts != null) {
            project.setArtifacts(artifacts);
        }
    }
    setVariableValueToObject(mojo, "compilePath", project.getCompileClasspathElements());
    setVariableValueToObject(mojo, "session", session);
    setVariableValueToObject(mojo, "executable", "java");
    setVariableValueToObject(mojo, "basedir", new File(getBasedir(), parent));

    return mojo;
}
 
源代码2 项目: jax-maven-plugin   文件: Util.java
static Stream<String> getPluginRuntimeDependencyEntries(AbstractMojo mojo, MavenProject project, Log log,
        RepositorySystem repositorySystem, ArtifactRepository localRepository,
        List<ArtifactRepository> remoteRepositories) {
    PluginDescriptor pluginDescriptor = (PluginDescriptor) mojo.getPluginContext().get(PLUGIN_DESCRIPTOR);
    Plugin plugin = project.getBuild().getPluginsAsMap().get(pluginDescriptor.getPluginLookupKey());

    List<ArtifactResolutionResult> artifactResolutionResults = plugin //
            .getDependencies() //
            .stream() //
            .map(repositorySystem::createDependencyArtifact) //
            .map(a -> Util.resolve(log, a, repositorySystem, localRepository, remoteRepositories)) //
            .collect(Collectors.toList());

    Stream<Artifact> originalArtifacts = artifactResolutionResults.stream()
            .map(ArtifactResolutionResult::getOriginatingArtifact);

    Stream<Artifact> childArtifacts = artifactResolutionResults.stream()
            .flatMap(resolutionResult -> resolutionResult.getArtifactResolutionNodes().stream())
            .map(ResolutionNode::getArtifact);

    return Stream.concat(originalArtifacts, childArtifacts).map(Artifact::getFile).map(File::getAbsolutePath);
}
 
源代码3 项目: camel-spring-boot   文件: SpringBootStarterMojo.java
private Set<String> filterIncludedArtifacts(Set<String> artifacts) {

        Set<Artifact> dependencies;
        try {
            Artifact artifact = project.getArtifactMap().get(getMainDepGroupId() + ":" + getMainDepArtifactId());
            ProjectBuildingResult result = projectBuilder.build(artifact, project.getProjectBuildingRequest());
            MavenProject prj = result.getProject();
            prj.setRemoteArtifactRepositories(project.getRemoteArtifactRepositories());
            dependencies = projectDependenciesResolver.resolve(prj, Collections.singleton(Artifact.SCOPE_COMPILE), session);
        } catch (Exception e) {
            throw new RuntimeException("Unable to build project dependency tree", e);
        }

        Set<String> included = new TreeSet<>();
        dependencies.stream()
                .filter(a -> !Artifact.SCOPE_TEST.equals(a.getScope()))
                .map(a -> a.getGroupId() + ":" + a.getArtifactId())
                .forEach(included::add);
        included.retainAll(artifacts);

        return included;
    }
 
源代码4 项目: sarl   文件: MavenHelper.java
/** Resolve the artifacts with the given key.
 *
 * @param groupId the group identifier.
 * @param artifactId the artifact identifier.
 * @return the discovered artifacts.
 * @throws MojoExecutionException if resolution cannot be done.
 * @since 0.8
 */
public Set<Artifact> resolve(String groupId, String artifactId) throws MojoExecutionException {
	final ArtifactResolutionRequest request = new ArtifactResolutionRequest();
	request.setResolveRoot(true);
	request.setResolveTransitively(true);
	request.setLocalRepository(getSession().getLocalRepository());
	request.setRemoteRepositories(getSession().getCurrentProject().getRemoteArtifactRepositories());
	request.setOffline(getSession().isOffline());
	request.setForceUpdate(getSession().getRequest().isUpdateSnapshots());
	request.setServers(getSession().getRequest().getServers());
	request.setMirrors(getSession().getRequest().getMirrors());
	request.setProxies(getSession().getRequest().getProxies());
	request.setArtifact(createArtifact(groupId, artifactId));

	final ArtifactResolutionResult result = resolve(request);

	return result.getArtifacts();
}
 
源代码5 项目: netbeans   文件: EarImpl.java
private EarImpl.MavenModule findMavenModule(Artifact art, EarImpl.MavenModule[] mm) {
    EarImpl.MavenModule toRet = null;
    for (EarImpl.MavenModule m : mm) {
        if (art.getGroupId().equals(m.groupId) && art.getArtifactId().equals(m.artifactId)) {
            m.artifact = art;
            toRet = m;
            break;
        }
    }
    if (toRet == null) {
        toRet = new EarImpl.MavenModule();
        toRet.artifact = art;
        toRet.groupId = art.getGroupId();
        toRet.artifactId = art.getArtifactId();
        toRet.classifier = art.getClassifier();
        //add type as well?
    }
    return toRet;
}
 
源代码6 项目: kogito-runtimes   文件: AbstractKieMojo.java
protected boolean hasClassOnClasspath(MavenProject project, String className) {
    try {
        Set<Artifact> elements = project.getArtifacts();
        URL[] urls = new URL[elements.size()];

        int i = 0;
        Iterator<Artifact> it = elements.iterator();
        while (it.hasNext()) {
            Artifact artifact = it.next();

            urls[i] = artifact.getFile().toURI().toURL();
            i++;
        }
        try (URLClassLoader cl = new URLClassLoader(urls)) {
            cl.loadClass(className);
        }
        return true;
    } catch (Exception e) {
        return false;
    }
}
 
/**
 * {@inheritDoc}
 */
public JnlpDependencyRequest createRequest( Artifact artifact, boolean outputJarVersion, boolean useUniqueVersions )
{

    if ( globalConfig == null )
    {
        throw new IllegalStateException( "No config found, use init method before creating a request" );
    }

    JnlpDependencyConfig config = createConfig( artifact, outputJarVersion, useUniqueVersions );

    JnlpDependencyTask[] tasks = createTasks( config );

    JnlpDependencyRequest request = new JnlpDependencyRequest( config, tasks );
    return request;
}
 
源代码8 项目: code-hidding-plugin   文件: ProGuardMojo.java
private static File getClasspathElement(Artifact artifact, MavenProject mavenProject)
                                                                                     throws MojoExecutionException {
    if (artifact.getClassifier() != null) {
        return artifact.getFile();
    }
    String refId = artifact.getGroupId() + ":" + artifact.getArtifactId();
    MavenProject project = (MavenProject) mavenProject.getProjectReferences().get(refId);
    if (project != null) {
        return new File(project.getBuild().getOutputDirectory());
    } else {
        File file = artifact.getFile();
        if ((file == null) || (!file.exists())) {
            throw new MojoExecutionException("Dependency Resolution Required " + artifact);
        }
        return file;
    }
}
 
源代码9 项目: botsing   文件: BotsingMojo.java
public List<Artifact> getDependencyTree(DependencyInputType dependencyType) throws MojoExecutionException {
	try {
		ProjectBuildingRequest buildingRequest = getProjectbuildingRequest(dependencyType);

		// TODO check if it is necessary to specify an artifact filter
		DependencyNode rootNode = dependencyGraphBuilder.buildDependencyGraph(buildingRequest, null,
				reactorProjects);

		List<Artifact> artifactList = new ArrayList<Artifact>();
		addChildDependencies(rootNode, artifactList);

		return artifactList;

	} catch (DependencyGraphBuilderException e) {
		throw new MojoExecutionException("Couldn't download artifact: " + e.getMessage(), e);
	}
}
 
源代码10 项目: vertx-maven-plugin   文件: AbstractVertxMojo.java
/**
 * this method helps in resolving the {@link Artifact} as maven coordinates
 * coordinates ::= group:artifact[:packaging[:classifier]]:version
 *
 * @param artifact - the artifact which need to be represented as maven coordinate
 * @return string representing the maven coordinate
 */
protected String asMavenCoordinates(Artifact artifact) {
    // TODO-ROL: Shouldn't there be also the classified included after the groupId (if given ?)
    // Maybe we we should simply reuse DefaultArtifact.toString() (but could be too fragile as it might change
    // although I don't think it will change any time soon since probably many people already
    // rely on it)
    StringBuilder artifactCords = new StringBuilder().
        append(artifact.getGroupId())
        .append(":")
        .append(artifact.getArtifactId());
    if (!"jar".equals(artifact.getType()) || artifact.hasClassifier()) {
        artifactCords.append(":").append(artifact.getType());
    }
    if (artifact.hasClassifier()) {
        artifactCords.append(":").append(artifact.getClassifier());
    }
    artifactCords.append(":").append(artifact.getVersion());
    return artifactCords.toString();
}
 
private Artifact getScalaScoverageRuntimeArtifact( String scalaMainVersion )
    throws ArtifactNotFoundException, ArtifactResolutionException
{
    Artifact result = null;

    String resolvedScalacRuntimeVersion = scalacPluginVersion;
    if ( resolvedScalacRuntimeVersion == null || "".equals( resolvedScalacRuntimeVersion ) )
    {
        for ( Artifact artifact : pluginArtifacts )
        {
            if ( "org.scoverage".equals( artifact.getGroupId() )
                && "scalac-scoverage-plugin_2.12".equals( artifact.getArtifactId() ) )
            {
                resolvedScalacRuntimeVersion = artifact.getVersion();
                break;
            }
        }
    }

    result =
        getResolvedArtifact( "org.scoverage", "scalac-scoverage-runtime_" + scalaMainVersion,
                             resolvedScalacRuntimeVersion );
    return result;
}
 
源代码12 项目: appassembler   文件: AbstractScriptGeneratorMojo.java
protected void installDependencies( final String outputDirectory, final String repositoryName )
    throws MojoExecutionException, MojoFailureException
{
    if ( generateRepository )
    {
        // The repo where the jar files will be installed
        ArtifactRepository artifactRepository =
            artifactRepositoryFactory.createDeploymentArtifactRepository( "appassembler", "file://"
                + outputDirectory + "/" + repositoryName, getArtifactRepositoryLayout(), false );

        for ( Artifact artifact : artifacts )
        {
            installArtifact( artifact, artifactRepository, this.useTimestampInSnapshotFileName );
        }

        // install the project's artifact in the new repository
        installArtifact( projectArtifact, artifactRepository );
    }
}
 
源代码13 项目: java-specialagent   文件: MutableMojo.java
static void resolveDependencies(final MavenSession session, final MojoExecution execution, final MojoExecutor executor, final ProjectDependenciesResolver projectDependenciesResolver) throws DependencyResolutionException, LifecycleExecutionException {
//    flushProjectArtifactsCache(executor);

    final MavenProject project = session.getCurrentProject();
    final Set<Artifact> dependencyArtifacts = project.getDependencyArtifacts();
    final Map<String,List<MojoExecution>> executions = new LinkedHashMap<>(execution.getForkedExecutions());
    final ExecutionListener executionListener = session.getRequest().getExecutionListener();
    try {
      project.setDependencyArtifacts(null);
      execution.getForkedExecutions().clear();
      session.getRequest().setExecutionListener(null);
      executor.execute(session, Collections.singletonList(execution), new ProjectIndex(session.getProjects()));
    }
    finally {
      execution.getForkedExecutions().putAll(executions);
      session.getRequest().setExecutionListener(executionListener);
      project.setDependencyArtifacts(dependencyArtifacts);
    }

    projectDependenciesResolver.resolve(newDefaultDependencyResolutionRequest(session));
  }
 
源代码14 项目: webstart   文件: AbstractJnlpMojo.java
/**
 * @param pattern   pattern to test over artifacts
 * @param artifacts collection of artifacts to check
 * @return true if filter matches no artifact, false otherwise *
 */
private boolean ensurePatternMatchesAtLeastOneArtifact( String pattern, Collection<Artifact> artifacts )
{
    List<String> onePatternList = new ArrayList<>();
    onePatternList.add( pattern );
    ArtifactFilter filter = new IncludesArtifactFilter( onePatternList );

    boolean noMatch = true;
    for ( Artifact artifact : artifacts )
    {
        getLog().debug( "checking pattern: " + pattern + " against " + artifact );

        if ( filter.include( artifact ) )
        {
            noMatch = false;
            break;
        }
    }
    if ( noMatch )
    {
        getLog().error( "pattern: " + pattern + " doesn't match any artifact." );
    }
    return noMatch;
}
 
源代码15 项目: ci.maven   文件: DeployMojo.java
protected void installDependencies() throws Exception {
    Set<Artifact> artifacts = project.getArtifacts();
    log.debug("Number of compile dependencies for " + project.getArtifactId() + " : " + artifacts.size());
    
    for (Artifact artifact : artifacts) {
        // skip if not an application type supported by Liberty
        if (!isSupportedType(artifact.getType())) {
            continue;
        }
        // skip assemblyArtifact if specified as a dependency
        if (assemblyArtifact != null && matches(artifact, assemblyArtifact)) {
            continue;
        }
        if (artifact.getScope().equals("compile")) {
            if (isSupportedType(artifact.getType())) {
                if (looseApplication && isReactorMavenProject(artifact)) {  //Installing the reactor project artifacts
                    MavenProject dependProj = getReactorMavenProject(artifact);
                    installLooseApplication(dependProj);
                } else {
                    installApp(resolveArtifact(artifact));
                }
            } else {
                log.warn(MessageFormat.format(messages.getString("error.application.not.supported"),
                        project.getId()));
            }
        }
    }
}
 
源代码16 项目: cxf   文件: OptionLoader.java
public static List<WadlOption> loadWsdlOptionsFromDependencies(MavenProject project,
                                                               Option defaultOptions, File outputDir) {
    List<WadlOption> options = new ArrayList<>();
    Set<Artifact> dependencies = project.getDependencyArtifacts();
    for (Artifact artifact : dependencies) {
        WadlOption option = generateWsdlOptionFromArtifact(artifact, outputDir);
        if (option != null) {
            if (defaultOptions != null) {
                option.merge(defaultOptions);
            }
            options.add(option);
        }
    }
    return options;
}
 
源代码17 项目: netbeans   文件: GraphConstructor.java
private int obtainManagedState(MavenDependencyNode dependencyNode) {        
    if (proj == null) {
        return GraphNode.UNMANAGED;
    }

    DependencyManagement dm = proj.getDependencyManagement();
    if (dm == null) {
        return GraphNode.UNMANAGED;
    }

    @SuppressWarnings("unchecked")
    List<Dependency> deps = dm.getDependencies();
    if (deps == null) {
        return GraphNode.UNMANAGED;
    }

    Artifact artifact = dependencyNode.getArtifact();
    String id = artifact.getArtifactId();
    String groupId = artifact.getGroupId();
    String version = artifact.getVersion();

    for (Dependency dep : deps) {
        if (id.equals(dep.getArtifactId()) && groupId.equals(dep.getGroupId())) {
            if (!version.equals(dep.getVersion())) {
                return GraphNode.OVERRIDES_MANAGED;
            } else {
                return GraphNode.MANAGED;
            }
        }
    }

    return GraphNode.UNMANAGED;
}
 
源代码18 项目: pgpverify-maven-plugin   文件: ScopeSkipperTest.java
@Test
public void testConstructCompileRuntimeScopeFilter() {
    final ScopeSkipper filter = new ScopeSkipper(Artifact.SCOPE_COMPILE_PLUS_RUNTIME);
    assertFalse(filter.shouldSkipArtifact(new DefaultArtifact("a", "b", "1.0", "system", "jar", "classifier", null)));
    assertFalse(filter.shouldSkipArtifact(new DefaultArtifact("a", "b", "1.0", "provided", "jar", "classifier", null)));
    assertFalse(filter.shouldSkipArtifact(new DefaultArtifact("a", "b", "1.0", "compile", "jar", "classifier", null)));
    assertFalse(filter.shouldSkipArtifact(new DefaultArtifact("a", "b", "1.0", "runtime", "jar", "classifier", null)));
    assertTrue(filter.shouldSkipArtifact(new DefaultArtifact("a", "b", "1.0", "test", "jar", "classifier", null)));
}
 
源代码19 项目: deadcode4j   文件: ModuleGenerator.java
private boolean addKnownArtifact(
        @Nonnull List<Resource> resources,
        @Nonnull Artifact artifact,
        @Nonnull Map<String, Module> knownModules) {
    String dependencyKey = getKeyFor(artifact);
    Module knownModule = knownModules.get(dependencyKey);
    if (knownModule == null) {
        return false;
    }
    resources.add(Resource.of(knownModule));
    logger.debug("  Added project: [{}]", knownModule);
    return true;
}
 
源代码20 项目: component-runtime   文件: ArtifactTransformer.java
protected boolean isComponent(final Artifact artifact) {
    final File file = artifact.getFile();
    if (file.isDirectory()) {
        return new File(file, "TALEND-INF/dependencies.txt").exists();
    }
    try (final JarFile jar = new JarFile(file)) {
        return jar.getEntry("TALEND-INF/dependencies.txt") != null;
    } catch (final IOException ioe) {
        return false;
    }
}
 
源代码21 项目: depgraph-maven-plugin   文件: DependencyNodeUtil.java
public static void addTypes(DependencyNode dependencyNode, String... types) {
  for (String type : types) {
    Artifact artifact = dependencyNode.getArtifact();
    DependencyNode nodeWithClassifier = new DependencyNode(createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getScope(), type, artifact.getClassifier(), artifact.isOptional()));
    dependencyNode.merge(nodeWithClassifier);
  }
}
 
源代码22 项目: netbeans   文件: DependencyNode.java
@Override
public void actionPerformed(ActionEvent event) {
    final Collection<? extends Artifact> artifacts = lkp.lookupAll(Artifact.class);
    if (artifacts.isEmpty()) {
        return;
    }
    Collection<? extends NbMavenProjectImpl> res = lkp.lookupAll(NbMavenProjectImpl.class);
    Set<NbMavenProjectImpl> prjs = new HashSet<NbMavenProjectImpl>(res);
    if (prjs.size() != 1) {
        return;
    }

    final NbMavenProjectImpl project = prjs.iterator().next();
    final List<Artifact> unremoved = new ArrayList<Artifact>();

    final ModelOperation<POMModel> operation = new ModelOperation<POMModel>() {
        @Override
        public void performOperation(POMModel model) {
            for (Artifact art : artifacts) {
                org.netbeans.modules.maven.model.pom.Dependency dep =
                        model.getProject().findDependencyById(art.getGroupId(), art.getArtifactId(), null);
                if (dep != null) {
                    model.getProject().removeDependency(dep);
                } else {
                    unremoved.add(art);
                }
            }
        }
    };
    RP.post(new Runnable() {
        @Override
        public void run() {
            FileObject fo = FileUtil.toFileObject(project.getPOMFile());
            Utilities.performPOMModelOperations(fo, Collections.singletonList(operation));
            if (unremoved.size() > 0) {
                StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(DependencyNode.class, "MSG_Located_In_Parent", unremoved.size()), Integer.MAX_VALUE);
            }
        }
    });
}
 
源代码23 项目: cxf   文件: AbstractCodegenMojo.java
private Artifact resolveDependentWsdl(Artifact artifact) {
    Collection<String> scopes = new ArrayList<>();
    scopes.add(Artifact.SCOPE_RUNTIME);
    Set<Artifact> artifactSet = null;
    try {
        artifactSet = projectDependencyResolver.resolve(project, scopes, mavenSession);
    } catch (AbstractArtifactResolutionException e) {
        getLog().info("Error resolving dependent wsdl artifact.", e);
    }
    return findWsdlArtifact(artifact, artifactSet);
}
 
源代码24 项目: extra-enforcer-rules   文件: JarUtilsTest.java
/**
 * "Sunny day" test: the method should return true for a jar artifact.
 */
@Test
public void isJarFileShouldReturnTrueForJarFile()
{
    Artifact artifact = newBuilder().withType( "jar" ).build();
    assertTrue( JarUtils.isJarFile( artifact ) );
}
 
/**
 * Returns {@code true} if the provided {@code Model} has a dependency on the Dataflow Java SDK
 * with a version other than LATEST or RELEASE.
 */
public boolean hasPinnedDataflowDependency(IProject project) {
  Model model = getModelFromProject(project);
  if (model == null) {
    return false;
  }
  Dependency dependency = getDataflowDependencyFromModel(model);
  if (dependency == null
      || Artifact.LATEST_VERSION.equals(dependency.getVersion())
      || Artifact.RELEASE_VERSION.equals(dependency.getVersion())) {
    return false;
  }
  return true;
}
 
源代码26 项目: roboconf-platform   文件: ResolveMojoTest.java
@Test( expected = MojoExecutionException.class )
public void testWithInvalidRoboconfDependencies() throws Exception {

	// Prepare the project
	final String projectName = "project--valid";

	File baseDir = this.resources.getBasedir( projectName );
	Assert.assertNotNull( baseDir );
	Assert.assertTrue( baseDir.isDirectory());

	AbstractMojo mojo = findMojo( projectName, "resolve" );
	this.rule.setVariableValueToObject( mojo, "repoSystem", newRepositorySystem());
	this.rule.setVariableValueToObject( mojo, "repositories", new ArrayList<RemoteRepository>( 0 ));

	// Add dependencies
	MavenProject project = (MavenProject) this.rule.getVariableValueFromObject( mojo, "project" );
	project.setDependencyArtifacts( new HashSet<Artifact> ());

	Artifact notRbcfArtifact1 = new DefaultArtifact( "net.roboconf", "roboconf-core", "0.2", "runtime", "jar", null, new DefaultArtifactHandler());
	project.getDependencyArtifacts().add( notRbcfArtifact1 );

	Artifact notRbcfArtifact2 = new DefaultArtifact( "net.roboconf", "roboconf-core", "0.2", "runtime", "jar", null, new DefaultArtifactHandler());
	notRbcfArtifact2.setFile( new File( "file that does not exist" ));
	project.getDependencyArtifacts().add( notRbcfArtifact2 );

	Artifact notRbcfArtifact3 = new DefaultArtifact( "net.roboconf", "roboconf-core", "0.2", "runtime", "jar", null, new DefaultArtifactHandler());
	File temp = this.folder.newFile( "toto.zip" );
	Assert.assertTrue( temp.exists());

	notRbcfArtifact3.setFile( temp );
	project.getDependencyArtifacts().add( notRbcfArtifact3 );

	// Execute it
	File targetDir = new File( baseDir, MavenPluginConstants.TARGET_MODEL_DIRECTORY + "/" + Constants.PROJECT_DIR_GRAPH );
	Assert.assertFalse( targetDir.isDirectory());
	mojo.execute();
}
 
源代码27 项目: wildfly-swarm   文件: StartMojo.java
List<Path> dependencies(final Path archiveContent,
                        final boolean scanDependencies) throws MojoFailureException {
    final List<Path> elements = new ArrayList<>();
    final Set<Artifact> artifacts = this.project.getArtifacts();
    boolean hasSwarmDeps = false;
    for (Artifact each : artifacts) {
        if (each.getGroupId().equals(DependencyManager.WILDFLY_SWARM_GROUP_ID)
                && each.getArtifactId().equals(DependencyManager.WILDFLY_SWARM_BOOTSTRAP_ARTIFACT_ID)) {
            hasSwarmDeps = true;
        }
        if (each.getGroupId().equals("org.jboss.logmanager")
                && each.getArtifactId().equals("jboss-logmanager")) {
            continue;
        }
        if (each.getScope().equals("provided")) {
            continue;
        }
        elements.add(each.getFile().toPath());
    }

    elements.add(Paths.get(this.project.getBuild().getOutputDirectory()));

    if (fractionDetectMode != BuildTool.FractionDetectionMode.never) {
        if (fractionDetectMode == BuildTool.FractionDetectionMode.force ||
                !hasSwarmDeps) {
            elements.addAll(findNeededFractions(artifacts, archiveContent, scanDependencies));
        }
    } else if (!hasSwarmDeps) {
        getLog().warn("No WildFly Swarm dependencies found and fraction detection disabled");
    }

    return elements;
}
 
源代码28 项目: mvn-golang   文件: AbstractGoDependencyAwareMojo.java
@Nonnull
@MustNotContainNull
private List<Tuple<GoMod, File>> listRightPart(@Nonnull @MustNotContainNull final List<Tuple<Artifact, Tuple<GoMod, File>>> list) {
  final List<Tuple<GoMod, File>> parsed = new ArrayList<>();
  for (final Tuple<Artifact, Tuple<GoMod, File>> i : list) {
    parsed.add(i.right());
  }
  return parsed;
}
 
源代码29 项目: deadcode4j   文件: ModuleGenerator.java
private Predicate<Artifact> artifactsWithCompileScope() {
    return new Predicate<Artifact>() {
        private ScopeArtifactFilter artifactFilter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE);

        @Override
        public boolean apply(@Nullable Artifact input) {
            return input != null && artifactFilter.include(input);
        }
    };
}
 
源代码30 项目: appassembler   文件: DependencyFactory.java
/**
 * Used by AbstractBooterDaemonGenerator.
 * @param project {@link MavenProject}
 * @param id The id.
 * @param layout {@link ArtifactRepositoryLayout}
 * @param outputFileNameMapping The name mapping.
 * @return the dependency.
 */
public static Dependency create( MavenProject project, String id, ArtifactRepositoryLayout layout,
                                 String outputFileNameMapping )
    throws DaemonGeneratorException
{
    Artifact artifact = (Artifact) project.getArtifactMap().get( id );

    if ( artifact == null )
    {
        throw new DaemonGeneratorException( "The project has to have a dependency on '" + id + "'." );
    }

    return create( artifact, layout, outputFileNameMapping );
}