Package org.eclipse.aether.artifact

Examples of org.eclipse.aether.artifact.DefaultArtifact


    @Test
    public void testGAemptyTCV() {
        final String coords = "g:a::sources:1";

        Artifact artifact = new DefaultArtifact(coords);
        Assert.assertEquals("g", artifact.getGroupId());
        Assert.assertEquals("a", artifact.getArtifactId());
        Assert.assertEquals("1", artifact.getVersion());
        Assert.assertEquals("sources", artifact.getClassifier());
        Assert.assertEquals("jar", artifact.getExtension());

        MavenCoordinateParser dependency = MavenCoordinateParser.parse(coords);
        Assert.assertEquals("g", dependency.getGroupId());
        Assert.assertEquals("a", dependency.getArtifactId());
        Assert.assertEquals("1", dependency.getVersion());
View Full Code Here


        Assert.assertEquals("jar", dependency.getPackaging().toString());
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGAemptyTemptyCV() {
        Artifact artifact = new DefaultArtifact("g:a:::1");
        Assert.assertEquals("g", artifact.getGroupId());
        Assert.assertEquals("a", artifact.getArtifactId());
        Assert.assertEquals("1", artifact.getVersion());
        Assert.assertEquals("sources", artifact.getClassifier());
        Assert.assertEquals("jar", artifact.getExtension());
    }
View Full Code Here

     * java.lang.String)
     */
    @Override
    public ModelSource resolveModel(String groupId, String artifactId, String version)
        throws UnresolvableModelException {
        Artifact pomArtifact = new DefaultArtifact(groupId, artifactId, "", "pom", version);
        try {
            final ArtifactRequest request = new ArtifactRequest(pomArtifact, repositories, null);
            pomArtifact = system.resolveArtifact(session, request).getArtifact();

        } catch (ArtifactResolutionException e) {
            throw new UnresolvableModelException("Failed to resolve POM for " + groupId + ":" + artifactId + ":"
                + version + " due to " + e.getMessage(), groupId, artifactId, version, e);
        }

        final File pomFile = pomArtifact.getFile();

        return new FileModelSource(pomFile);

    }
View Full Code Here

            }
            if (version == null || version.equals("")) {
                version = getXPathParentVersionExpression().evaluate(pom);
            }

            final Artifact foundArtifact = new DefaultArtifact(groupId + ":" + artifactId + ":" + type + ":" + version);
            foundArtifact.setFile(pomFile);
            return foundArtifact;
        } catch (final Exception e) {
            throw new RuntimeException("Could not parse pom.xml: " + pomFile, e);
        }
    }
View Full Code Here

    */
   @Override
   public ModelSource resolveModel(String groupId, String artifactId, String version)
            throws UnresolvableModelException
   {
      Artifact pomArtifact = new DefaultArtifact(groupId, artifactId, "", "pom", version);
      try
      {
         final ArtifactRequest request = new ArtifactRequest(pomArtifact, repositories, null);
         pomArtifact = system.resolveArtifact(session, request).getArtifact();

      }
      catch (ArtifactResolutionException e)
      {
         throw new UnresolvableModelException("Failed to resolve POM for " + groupId + ":" + artifactId + ":"
                  + version + " due to " + e.getMessage(), groupId, artifactId, version, e);
      }

      final File pomFile = pomArtifact.getFile();

      return new FileModelSource(pomFile);

   }
View Full Code Here

    Artifact artifact;
    try {


      artifact = new DefaultArtifact( this.getProject().getArtifact().toString() );


      DependencyService dependencyService = new DependencyService();

      ConsoleVisualizer consoleVisualizer = new ConsoleVisualizer();
View Full Code Here

    super.printStartParameter( "html" );

    Artifact artifact;
    try {

      artifact = new DefaultArtifact( this.getProject().getArtifact().toString() );



      UserParameterWrapper userParameterWrapper = new UserParameterWrapper(this.getIncludedScopesList(),this.getExcludedScopesList(),this.isIncludeOptional(),this.getSeverity()  );
        //ViewScopeManager initialisieren
View Full Code Here

    super.printStartParameter( "list" );

    Artifact artifact;
    try {

      artifact = new DefaultArtifact( this.getProject().getArtifact().toString() );


      DependencyService dependencyService = new DependencyService();

      ConsoleVisualizer consoleVisualizer = new ConsoleVisualizer();
View Full Code Here

    super.printStartParameter( "html" );

    Artifact artifact;
    try {

      artifact = new DefaultArtifact( this.getProject().getArtifact().toString() );



      UserParameterWrapper userParameterWrapper = new UserParameterWrapper(this.getIncludedScopesList(),this.getExcludedScopesList(),this.isIncludeOptional(),this.getSeverity()  );
        //ViewScopeManager initialisieren
View Full Code Here

    super.execute();
    super.printStartParameter( "tree" );

    try {

      Artifact artifact = new DefaultArtifact( this.getProject().getArtifact().toString() );

      DependencyService dependencyService = new DependencyService();
      Visualizer consoleVisualizer = new ConsoleVisualizer();

      ClashCollectResultWrapper clashCollectResultWrapper = new ClashCollectResultWrapper( dependencyService.getDependencyTree( artifact, this.getRepoSession(), this.getRepoSystem(), this.getIncludedScopesList(), this.getExcludedScopesList(), this.isIncludeOptional() ) );
View Full Code Here

TOP

Related Classes of org.eclipse.aether.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.