Package org.apache.maven.artifact

Examples of org.apache.maven.artifact.DefaultArtifact


                                                                        } );

        setupDefaultProject( project );

        ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
        String path = repo.pathOf( new DefaultArtifact( "test",
                                                        "test",
                                                        VersionRange.createFromVersion( "1.3" ),
                                                        null,
                                                        "jar",
                                                        "",
View Full Code Here


                                                                        } );

        setupDefaultProject( project );

        ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
        String path = repo.pathOf( new DefaultArtifact( "test",
                                                        "test",
                                                        VersionRange.createFromVersion( "1.1" ),
                                                        null,
                                                        "jar",
                                                        "",
View Full Code Here

        project.addProperty( "testingPropertyOne", "maven" );
        project.addProperty( "testingPropertyTwo", "rules" );

        ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
        String path = repo.pathOf( new DefaultArtifact( "test-filtered-bundles", "test-filtered-bundles",
                                                        VersionRange.createFromVersion( "2" ), null, "jar", "",
                                                        new DefaultArtifactHandler() ) );

        File file = new File( repo.getBasedir() + "/" + path + ".jar" );
        file.getParentFile().mkdirs();
View Full Code Here

        if ( artifact == null )
        {
            final ArtifactHandler ah = new DefaultArtifactHandlerStub( "jar", null );

            final VersionRange vr = VersionRange.createFromVersion( "1.0" );
            final Artifact art = new DefaultArtifact( "group", "artifact", vr, Artifact.SCOPE_COMPILE, "jar", null, ah, false );
            setArtifact( art );
        }
        return artifact;
    }
View Full Code Here

    public void projectScannerPlugin() throws IOException {
        MavenProjectMavenScannerPlugin scannerPlugin = new MavenProjectMavenScannerPlugin();

        // Mock parent project
        MavenProject parentProject = mock(MavenProject.class);
        Artifact parentArtifact = new DefaultArtifact("group", "parent-artifact", VersionRange.createFromVersion("1.0.0"), null, "pom", "main", null);
        when(parentProject.getArtifact()).thenReturn(parentArtifact);
        when(parentProject.getPackaging()).thenReturn("pom");

        // Mock project
        MavenProject project = mock(MavenProject.class);
        when(project.getName()).thenReturn("project");
        Artifact artifact = new DefaultArtifact("group", "artifact", VersionRange.createFromVersion("1.0.0"), null, "jar", "main", null);
        when(project.getArtifact()).thenReturn(artifact);
        when(project.getPackaging()).thenReturn("jar");
        File basedir = mock(File.class);
        when(basedir.getAbsolutePath()).thenReturn("basedir");
        when(project.getBasedir()).thenReturn(basedir);
View Full Code Here

        tomEEMojo.local = new DefaultArtifactRepository("local", tomEEMojo.settings.getLocalRepository(), new DefaultRepositoryLayout());

        tomEEMojo.factory = ArtifactFactory.class.cast(Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{ArtifactFactory.class}, new InvocationHandler() {
            @Override
            public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
                return new DefaultArtifact(
                    tomEEMojo.tomeeGroupId,
                    tomEEMojo.tomeeArtifactId,
                    VersionRange.createFromVersion(tomEEMojo.tomeeVersion),
                    "provided",
                    tomEEMojo.tomeeType,
View Full Code Here

        artifactResolverField.set( mojo, mockArtifactResolver );

        // create and configure MavenProject
        MavenProject project = new MavenProject();
        ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE );
        Artifact artifact = new DefaultArtifact( "org.apache.myfaces.core", "myfaces-impl",
                                                 VersionRange.createFromVersion( "2.0.1-SNAPSHOT" ), "compile", "jar",
                                                 null, artifactHandler );
        mockArtifactResolver.resolve( artifact, null, null ); // setFile and setResolved
        project.setArtifact( artifact );
        Field projectField = ShadeMojo.class.getDeclaredField( "project" );
View Full Code Here

            desiredScope = Artifact.SCOPE_SYSTEM;
        }
       
        ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type );

        return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
                                    optional );
    }
View Full Code Here

            desiredScope = Artifact.SCOPE_SYSTEM;
        }

        ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type );

        return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
                                    optional );
    }
View Full Code Here

    protected Artifact createArtifact( String groupId, String artifactId, String type, String version )
    {
        VersionRange versionRange = VersionRange.createFromVersion( version );
        ArtifactHandler handler = new DefaultArtifactHandler();

        return new DefaultArtifact( groupId, artifactId, versionRange, null, type, null, handler );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.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.