Package org.eclipse.aether.artifact

Examples of org.eclipse.aether.artifact.DefaultArtifact


        {
            props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, dependency.getSystemPath() );
        }

        Artifact artifact =
            new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), null,
                                 dependency.getVersion(), props, stereotype );

        List<Exclusion> exclusions = new ArrayList<Exclusion>( dependency.getExclusions().size() );
        for ( org.apache.maven.model.Exclusion exclusion : dependency.getExclusions() )
        {
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
        {
            ArtifactRequest request = new ArtifactRequest( pomArtifact, repositories, context );
            request.setTrace( trace );
            pomArtifact = resolver.resolveArtifact( session, request ).getArtifact();
        }
        catch ( ArtifactResolutionException e )
        {
            throw new UnresolvableModelException( e.getMessage(), groupId, artifactId, version, e );
        }

        File pomFile = pomArtifact.getFile();

        return new FileModelSource( pomFile );
    }
View Full Code Here

    }

    public ModelSource resolveModel( Parent parent )
        throws UnresolvableModelException
    {
        Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom",
                                                 parent.getVersion() );

        VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context );
        versionRangeRequest.setTrace( trace );
View Full Code Here

            pomFile = modelPool.get( groupId, artifactId, version );
        }

        if ( pomFile == null )
        {
            Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version );

            try
            {
                ArtifactRequest request = new ArtifactRequest( pomArtifact, repositories, context );
                request.setTrace( trace );
                pomArtifact = resolver.resolveArtifact( session, request ).getArtifact();
            }
            catch ( ArtifactResolutionException e )
            {
                throw new UnresolvableModelException( e.getMessage(), groupId, artifactId, version, e );
            }

            pomFile = pomArtifact.getFile();
        }

        return new FileModelSource( pomFile );
    }
View Full Code Here

    }

    public ModelSource resolveModel( Parent parent )
        throws UnresolvableModelException
    {
        Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom",
                                                 parent.getVersion() );

        VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context );
        versionRangeRequest.setTrace( trace );
View Full Code Here

            String localPath = ( artifact.getFile() != null ) ? artifact.getFile().getPath() : "";
            props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, localPath );
        }

        Artifact result =
            new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(),
                                 artifact.getArtifactHandler().getExtension(), version, props,
                                 newArtifactType( artifact.getType(), artifact.getArtifactHandler() ) );
        result = result.setFile( artifact.getFile() );

        return result;
    }
View Full Code Here

        {
            props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, dependency.getSystemPath() );
        }

        Artifact artifact =
            new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), null,
                                 dependency.getVersion(), props, stereotype );

        List<Exclusion> exclusions = new ArrayList<Exclusion>( dependency.getExclusions().size() );
        for ( org.apache.maven.model.Exclusion exclusion : dependency.getExclusions() )
        {
View Full Code Here

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

        try {
            initialize();

            Artifact artifact = new DefaultArtifact(artifactName);

            DependencyResult dependencyResult = resolveArtifact(artifact);


View Full Code Here

    public void execute() throws MojoExecutionException, MojoFailureException {
        try {
//            FindAvailableVersions.main(null);
            initialize();

            Artifact artifact = new DefaultArtifact(artifactName);
            DependencyResult dependencyResult = resolveArtifact(artifact);

            artifact = dependencyResult.getRoot().getArtifact();

            List<ArtifactResult> dependencies = dependencyResult.getArtifactResults();

            if (className != null) {
                new ExecObject(getLog(),
                    artifact, dependencies, className,
                    parseArgs(),
                    systemProperties
                ).execute();
            }

            Class<?> installation = new URLClassLoader(new URL[]{artifact.getFile().toURI().toURL()}).loadClass("Installation");

            List<Object[]> entries = (List<Object[]>) OpenBean2.getStaticFieldValue(installation, "shortcuts");

            if (installTo == null) {
                installTo = findPath();
View Full Code Here

        repositories = new RepositoryParser().parse(remoteRepositories);

        session = Booter.newSession(system, 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.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.