Package org.sonatype.aether.util.artifact

Examples of org.sonatype.aether.util.artifact.DefaultArtifact


      }
   }

   public Artifact dependencyToMavenArtifact(final Dependency dep)
   {
      Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getClassifier(),
               dep.getPackagingType() == null ? "jar" : dep.getPackagingType(), dep.getVersion());
      return artifact;
   }
View Full Code Here


    /**
     * Takes "groupId:artifactId" and resolves available versions.
     */
    public VersionRangeResult resolveVersionRange(GAV gav) throws VersionRangeResolutionException {
        VersionRangeRequest rangeRequest = new VersionRangeRequest()
            .setArtifact(new DefaultArtifact( gav.ga()+":[0,)" ))
            .setRepositories(remoteRepositories);

        return resolveVersionRange(rangeRequest);
    }
View Full Code Here

     */
    public DependencyResult resolveDependencies(GAV a, String scope) throws DependencyResolutionException {
        DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter(scope);

        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setRoot(new Dependency(new DefaultArtifact(a.toString()), JavaScopes.COMPILE));
        collectRequest.setRepositories(remoteRepositories);

        DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, classpathFlter);

        return resolveDependencies(dependencyRequest);
View Full Code Here

    /**
     * Resolves a single jar artifact of the given coordinate and returns it.
     */
    public ArtifactResult resolveArtifact( GAV gav ) throws ArtifactResolutionException {
        return resolveArtifact(new DefaultArtifact(gav.toString()));
    }
View Full Code Here

        props.setProperty("timestamp",String.valueOf(System.currentTimeMillis()));
        DependencyResult dependencies = forceResolve(gav);
        int i=0;
        for (ArtifactResult ar : dependencies.getArtifactResults()) {
            Artifact a = ar.getArtifact();
            Artifact pom = new DefaultArtifact(a.getGroupId(),a.getArtifactId(),"pom",a.getVersion());

            props.put("pom."+i, resolveArtifact(pom).getAbsolutePath());
            props.put("jar." + i, a.getFile().getAbsolutePath());
            i++;
            files.add(a.getFile());
View Full Code Here

    private ArtifactRequest toArtifactRequest(ArtifactItem item) {
        return new ArtifactRequest(toDefaultArtifact(item), project.getRemoteProjectRepositories(), "project");
    }

    private org.sonatype.aether.artifact.Artifact toDefaultArtifact(ArtifactItem item) {
        return new DefaultArtifact(item.getGroupId(), item.getArtifactId(), item.getClassifier(), item.getType()/*extension*/, item.getVersion());
    }
View Full Code Here

        Preconditions.checkNotNull(className, "you need to set class name with -Dclass=your.ClassName");

        try {
            initialize();

            Artifact artifact = new DefaultArtifact(artifactName);

            ArtifactResults2 artifactResults = resolveArtifact(artifact);

            artifact = artifactResults.artifact;
View Full Code Here

//        Preconditions.checkArgument(repositoryFile.exists(), "could not find local repo at: %s", repositoryFile.getAbsolutePath());

        System.out.println( "------------------------------------------------------------" );
        System.out.println( FindAvailableVersions.class.getSimpleName() );

        Artifact artifact = new DefaultArtifact( "com.chaschev:chutils:[0,)" );

        VersionRangeResult rangeResult = new Aether(Lists.newArrayList(
            Booter.newCentralRepository(), Booter.newSonatypeRepository()
        ), repositoryFile).getVersions(artifact);
View Full Code Here

     * @return Root artifact
     */
    private RootArtifact root(final Dependency dep) {
        return new RootArtifact(
            this.aether,
            new DefaultArtifact(
                dep.getGroupId(),
                dep.getArtifactId(),
                dep.getClassifier(),
                dep.getType(),
                dep.getVersion()
View Full Code Here

        aether = new Aether(Lists.newArrayList(
            repositories
        ), repositoryFile);

        if ("LATEST".equals(artifactVersion)) {
            Artifact artifact = new DefaultArtifact(artifactName + ":[0,)");

            VersionRangeRequest rangeRequest = new VersionRangeRequest();

            rangeRequest.setArtifact( artifact );
            rangeRequest.setRepositories(repositories);
View Full Code Here

TOP

Related Classes of org.sonatype.aether.util.artifact.DefaultArtifact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.