• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InvalidDependencyVersionException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.project.artifact.InvalidDependencyVersionException的典型用法代码示例。如果您正苦于以下问题:Java InvalidDependencyVersionException类的具体用法?Java InvalidDependencyVersionException怎么用?Java InvalidDependencyVersionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InvalidDependencyVersionException类属于org.apache.maven.project.artifact包,在下文中一共展示了InvalidDependencyVersionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTransitiveDependencies

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
protected List getTransitiveDependencies( final Set previousArtifacts )
    throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException,
    ArtifactNotFoundException
{
    final List dependencies = new ArrayList();
    for ( Iterator iter = previousArtifacts.iterator(); iter.hasNext(); )
    {
        final Artifact a = (Artifact) iter.next();
        final Artifact pomArtifact =
            factory.createArtifact( a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getScope(), "pom" );
        final MavenProject pomProject =
            mavenProjectBuilder.buildFromRepository( pomArtifact, project.getRemoteArtifactRepositories(),
                                                     localRepository );
        final Set pomProjectArtifacts = pomProject.createArtifacts( factory, null, null );
        final ArtifactResolutionResult result =
            resolver.resolveTransitively( pomProjectArtifacts, pomArtifact, localRepository,
                                          project.getRemoteArtifactRepositories(), metadataSource, null );
        dependencies.addAll( result.getArtifacts() );
    }
    return dependencies;
}
 
开发者ID:mojohaus,项目名称:clirr-maven-plugin,代码行数:22,代码来源:AbstractClirrMojo.java


示例2: resolveEpisodeArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
protected void resolveEpisodeArtifacts()
		throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException {
	this.episodeArtifacts = new LinkedHashSet<Artifact>();
	{
		final Collection<Artifact> episodeArtifacts = ArtifactUtils.resolve(getArtifactFactory(),
				getArtifactResolver(), getLocalRepository(), getArtifactMetadataSource(), getEpisodes(),
				getProject());
		this.episodeArtifacts.addAll(episodeArtifacts);
	}
	{
		if (getUseDependenciesAsEpisodes()) {
			@SuppressWarnings("unchecked")
			final Collection<Artifact> projectArtifacts = getProject().getArtifacts();
			final AndArtifactFilter filter = new AndArtifactFilter();
			filter.add(new ScopeArtifactFilter(DefaultArtifact.SCOPE_COMPILE));
			filter.add(new TypeArtifactFilter("jar"));
			for (Artifact artifact : projectArtifacts) {
				if (filter.include(artifact)) {
					this.episodeArtifacts.add(artifact);
				}
			}
		}
	}
	this.episodeFiles = ArtifactUtils.getFiles(this.episodeArtifacts);
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:26,代码来源:RawXJC2Mojo.java


示例3: resolve

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public static Collection<Artifact> resolve(
		final ArtifactFactory artifactFactory,
		final ArtifactResolver artifactResolver,
		final ArtifactRepository localRepository,
		final ArtifactMetadataSource artifactMetadataSource,
		final Dependency[] dependencies, final MavenProject project)
		throws InvalidDependencyVersionException,
		ArtifactResolutionException, ArtifactNotFoundException {
	if (dependencies == null) {
		return Collections.emptyList();
	}

	@SuppressWarnings("unchecked")
	final Set<Artifact> artifacts = MavenMetadataSource.createArtifacts(
			artifactFactory, Arrays.asList(dependencies), "runtime", null,
			project);

	for (Artifact artifact : artifacts) {
		artifactResolver.resolve(artifact,

		project.getRemoteArtifactRepositories(), localRepository);
	}

	final Set<Artifact> resolvedArtifacts = artifacts;
	return resolvedArtifacts;
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:27,代码来源:ArtifactUtils.java


示例4: findArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
/**
 * Gathers the project's artifacts and the artifacts of all its (transitive)
 * dependencies filtered by the given filter instance.
 * 
 * @param filter
 * @return
 * @throws ArtifactResolutionException
 * @throws ArtifactNotFoundException
 * @throws ProjectBuildingException
 * @throws InvalidDependencyVersionException
 */
@SuppressWarnings("unchecked")
public static Set<Artifact> findArtifacts(ArtifactFilter filter,
		ArtifactFactory factory, ArtifactResolver resolver,
		MavenProject project, Artifact artifact, ArtifactRepository local,
		List<ArtifactRepository> remoteRepos,
		ArtifactMetadataSource metadataSource)
		throws ArtifactResolutionException, ArtifactNotFoundException,
		ProjectBuildingException, InvalidDependencyVersionException {

	ArtifactResolutionResult result = resolver.resolveTransitively(
			project.getDependencyArtifacts(), artifact, local, remoteRepos,
			metadataSource, filter);

	return (Set<Artifact>) result.getArtifacts();
}
 
开发者ID:tarent,项目名称:pkg-maven-plugin,代码行数:27,代码来源:Utils.java


示例5: resolveArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
protected void resolveArtifacts() throws MojoExecutionException {
	try {

		resolveXJCPluginArtifacts();
		resolveEpisodeArtifacts();
	} catch (ArtifactResolutionException arex) {
		throw new MojoExecutionException("Could not resolve the artifact.", arex);
	} catch (ArtifactNotFoundException anfex) {
		throw new MojoExecutionException("Artifact not found.", anfex);
	} catch (InvalidDependencyVersionException idvex) {
		throw new MojoExecutionException("Invalid dependency version.", idvex);
	}
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:14,代码来源:RawXJC2Mojo.java


示例6: resolveXJCPluginArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
protected void resolveXJCPluginArtifacts()
		throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException {

	this.xjcPluginArtifacts = ArtifactUtils.resolveTransitively(getArtifactFactory(), getArtifactResolver(),
			getLocalRepository(), getArtifactMetadataSource(), getPlugins(), getProject());
	this.xjcPluginFiles = ArtifactUtils.getFiles(this.xjcPluginArtifacts);
	this.xjcPluginURLs = CollectionUtils.apply(this.xjcPluginFiles, IOUtils.GET_URL);
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:9,代码来源:RawXJC2Mojo.java


示例7: resolveTransitively

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public static Collection<Artifact> resolveTransitively(
		final ArtifactFactory artifactFactory,
		final ArtifactResolver artifactResolver,
		final ArtifactRepository localRepository,
		final ArtifactMetadataSource artifactMetadataSource,
		final Dependency[] dependencies, final MavenProject project)
		throws InvalidDependencyVersionException,
		ArtifactResolutionException, ArtifactNotFoundException {
	if (dependencies == null) {
		return Collections.emptyList();
	}

	@SuppressWarnings("unchecked")
	final Set<Artifact> artifacts = MavenMetadataSource.createArtifacts(
			artifactFactory, Arrays.asList(dependencies), "runtime", null,
			project);

	final ArtifactResolutionResult artifactResolutionResult = artifactResolver
			.resolveTransitively(artifacts,

			project.getArtifact(),

			project.getRemoteArtifactRepositories(), localRepository,
					artifactMetadataSource);

	@SuppressWarnings("unchecked")
	final Set<Artifact> resolvedArtifacts = artifactResolutionResult
			.getArtifacts();

	return resolvedArtifacts;
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:32,代码来源:ArtifactUtils.java


示例8: createArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
    throws InvalidDependencyVersionException
{
    return Collections.EMPTY_SET;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:6,代码来源:DependencyProjectStub.java


示例9: createArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
@Deprecated
public Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter filter )
    throws InvalidDependencyVersionException
{
    return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, filter, this );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:MavenProject.java


示例10: InvalidPluginException

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public InvalidPluginException( String message, InvalidDependencyVersionException e )
{
    super( message, e );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:5,代码来源:InvalidPluginException.java


示例11: executeMojo

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public void executeMojo( MavenProject project, MojoExecution execution, MavenSession session )
    throws MojoExecutionException, ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException,
    InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException
{
    throw new UnsupportedOperationException();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:DefaultPluginManager.java


示例12: executeMojo

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
void executeMojo( MavenProject project, MojoExecution execution, MavenSession session )
throws MojoExecutionException, ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException,
InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException;
 
开发者ID:gems-uff,项目名称:oceano,代码行数:4,代码来源:PluginManager.java


示例13: aggregateProjectDependencyArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
@SuppressWarnings( "unchecked" )
private Set<Artifact> aggregateProjectDependencyArtifacts()
    throws MojoExecutionException
{
    Set<Artifact> artifacts = new LinkedHashSet<Artifact>();

    List<MavenProject> projects = mavenSession.getSortedProjects();
    for ( MavenProject p : projects )
    {
        if ( p.getDependencyArtifacts() == null )
        {
            try
            {
                Set<Artifact> depArtifacts = p.createArtifacts( artifactFactory, null, null );

                if ( depArtifacts != null && !depArtifacts.isEmpty() )
                {
                    for ( Artifact artifact : depArtifacts )
                    {
                        if ( artifact.getVersion() == null && artifact.getVersionRange() != null )
                        {
                            // Version is required for equality comparison between artifacts,
                            // but it is not needed for our purposes of filtering out
                            // transitive dependencies (which requires only groupId/artifactId).
                            // Therefore set an arbitrary version if missing.
                            artifact.setResolvedVersion( Artifact.LATEST_VERSION );
                        }
                        artifacts.add( artifact );
                    }  
                }
            }
            catch ( InvalidDependencyVersionException e )
            {
                throw new MojoExecutionException(
                    "Failed to create dependency artifacts for: " + p.getId() + ". Reason: " + e.getMessage(), e );
            }
        }
    }

    return artifacts;
}
 
开发者ID:dashie,项目名称:m2e-plugins,代码行数:42,代码来源:ProcessRemoteResourcesMojo.java


示例14: createArtifacts

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
@Override
public Set createArtifacts(final ArtifactFactory factory, final String s,
		final ArtifactFilter filter)
		throws InvalidDependencyVersionException {
	return getDelegate().createArtifacts(factory, s, filter);
}
 
开发者ID:jwrapper,项目名称:jwrapper-maven-plugin,代码行数:7,代码来源:MavenProjectDelegate.java


示例15: resolveProjectDependencies

import org.apache.maven.project.artifact.InvalidDependencyVersionException; //导入依赖的package包/类
public Set<Artifact> resolveProjectDependencies()
		throws MojoExecutionException {
	Set<Artifact> resolvedDeps = new HashSet<Artifact>();
	try {
		// Notice only compilation dependencies which are Jars.
		// Shared Libraries ("so") are filtered out because the
		// JNI dependency is solved by the system already.

		// Here a filter for depencies of the COMPILE scope is created
		AndArtifactFilter compileFilter = new AndArtifactFilter();
		compileFilter.add(new ScopeArtifactFilter(Artifact.SCOPE_COMPILE));
		compileFilter.add(new TypeArtifactFilter("jar"));

		// The result of the COMPILE filter will be added to the depencies
		// set
		resolvedDeps.addAll(Utils.findArtifacts(compileFilter, apm
				.getFactory(), apm.getResolver(), apm.getProject(), apm
				.getProject().getArtifact(), apm.getLocalRepo(), apm
				.getRemoteRepos(), apm.getMetadataSource()));

		// Here a filter for depencies of the RUNTIME scope is created
		AndArtifactFilter runtimeFilter = new AndArtifactFilter();
		runtimeFilter.add(new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME));
		runtimeFilter.add(new TypeArtifactFilter("jar"));

		// The result of the RUNTIME filter will be added to the depencies
		// set
		resolvedDeps.addAll(Utils.findArtifacts(runtimeFilter, apm
				.getFactory(), apm.getResolver(), apm.getProject(), apm
				.getProject().getArtifact(), apm.getLocalRepo(), apm
				.getRemoteRepos(), apm.getMetadataSource()));

		// Here a filter for depencies of the PROVIDED scope is created
		AndArtifactFilter providedFilter = new AndArtifactFilter();
		providedFilter
				.add(new ScopeArtifactFilter(Artifact.SCOPE_PROVIDED));
		providedFilter.add(new TypeArtifactFilter("jar"));

		// The result of the PROVIDED filter will be added to the depencies
		// set
		resolvedDeps.addAll(Utils.findArtifacts(providedFilter, apm
				.getFactory(), apm.getResolver(), apm.getProject(), apm
				.getProject().getArtifact(), apm.getLocalRepo(), apm
				.getRemoteRepos(), apm.getMetadataSource()));
	} catch (ArtifactNotFoundException anfe) {
		throw new MojoExecutionException(
				"Exception while resolving dependencies", anfe);
	} catch (InvalidDependencyVersionException idve) {
		throw new MojoExecutionException(
				"Exception while resolving dependencies", idve);
	} catch (ProjectBuildingException pbe) {
		throw new MojoExecutionException(
				"Exception while resolving dependencies", pbe);
	} catch (ArtifactResolutionException are) {
		throw new MojoExecutionException(
				"Exception while resolving dependencies", are);
	}

	return resolvedDeps;
}
 
开发者ID:tarent,项目名称:pkg-maven-plugin,代码行数:61,代码来源:Helper.java



注:本文中的org.apache.maven.project.artifact.InvalidDependencyVersionException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java File类代码示例发布时间:2022-05-22
下一篇:
Java AuditConstants类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap