Package org.sonatype.aether.util.artifact

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


  public Collection<GAV> resolveDependencies(GAV artifact) throws IOException {
    Collection<GAV> artifactDependencies = new ArrayList<GAV>();

    ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
    descriptorRequest.setArtifact(new DefaultArtifact(artifact.toString()));
    for (Repository repo : this.repositoryRegistry.getRepositories()) {
      if (repo.getLocalUrl() != null) {
        descriptorRequest.addRepository(new RemoteRepository(repo
            .getId(), "default", repo.getLocalUrl()));
      }
View Full Code Here


        RepositorySystem system = newRepositorySystem();

        RepositorySystemSession session = newRepositorySystemSession( system, resolveRequest.localRepoDir );

        org.sonatype.aether.artifact.Artifact artifact = new DefaultArtifact(
            resolveRequest.groupId + ":" + resolveRequest.artifactId + ":" + resolveRequest.version );

        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setRoot( new Dependency( artifact, "" ) );
View Full Code Here

      }
   }

   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

        }

        private List<Artifact> getArtifacts(String artifact) throws MojoExecutionException {
            Dependency dependency =
                new Dependency( new DefaultArtifact( artifact ), "runtime" );

            CollectRequest collectRequest = new CollectRequest();
            collectRequest.setRoot( dependency );
            //collectRequest.addRepository( remoteRepos );
View Full Code Here

       
            configWriter.write("\n# Auto-generated 'code' entries\n");
            for(Dependency dep : project.getDependencies())
            {
                String depString = dep.getGroupId()+":"+dep.getArtifactId()+":"+dep.getVersion();
                CollectRequest request = new CollectRequest(new org.sonatype.aether.graph.Dependency(new DefaultArtifact(depString), dep.getScope()),projectRepos);
                DependencyResult result = repoSystem.resolveDependencies(repoSession, new DependencyRequest(request, new ScopeDependencyFilter("test","provided")));

                for(ArtifactResult dependency : result.getArtifactResults())
                {
                    File d = dependency.getArtifact().getFile();
View Full Code Here

        assertEquals( "</li></ul></ul>", child3.getPost() );
    }

    private Artifact createPomArtifact( String groupId, String artifactId, String version )
    {
        return new DefaultArtifact( groupId + ":" + artifactId + ":" + version );
    }
View Full Code Here

        return new DefaultArtifact( groupId + ":" + artifactId + ":" + version );
    }

    private Artifact createArtifact( String groupId, String artifactId, String version )
    {
        return new DefaultArtifact( groupId, artifactId, "jar", version );
    }
View Full Code Here

        RepositorySystem system = newRepositorySystem();

        RepositorySystemSession session = newRepositorySystemSession( system, localRepoDir );

        org.sonatype.aether.artifact.Artifact artifact =
            new DefaultArtifact( groupId + ":" + artifactId + ":" + version );

        CollectRequest collectRequest = new CollectRequest();
        collectRequest.setRoot( new Dependency( artifact, "" ) );

        // add remote repositories ?
View Full Code Here

    @Test
    public void testArtifactTransfer()
        throws IOException, ArtifactTransferException
    {
        DefaultArtifact artifact = new DefaultArtifact( "test", "artId1", "jar", "1" );
        String expectedContent = "Dies ist ein Test.";

        uploadArtifact( artifact, expectedContent );

        File file = downloadArtifact( artifact );
View Full Code Here

        String enc = "%72%65%70%6F";
        File dir = TestFileUtils.createTempDir();
        String repoDir = dir.toURI().toURL().toString() + "/" + enc;
        repository = new RemoteRepository( "test", "default", repoDir );

        Artifact artifact = new DefaultArtifact( "gid", "aid", "jar", "ver" );
        String content = "test content";
        uploadArtifact( artifact, content );

        File repo = new File( dir, "repo" );
        assertTrue( "Repository from encoded URL does not exist.", repo.exists() );
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.