Package org.apache.maven.project

Examples of org.apache.maven.project.MavenProject


        ArtifactStub artifact = new ArtifactStub();
        artifact.setGroupId( "group" );
        artifact.setArtifactId( "artifact" );
        artifact.setVersion( "1.0.0.0" );

        MavenProject project = new MavenProjectStub();
        project.setGroupId( artifact.getGroupId() );
        project.setArtifactId( artifact.getArtifactId() );
        project.setVersion( artifact.getVersion() );
        project.setArtifact( artifact );
        project.setArtifacts( Collections.EMPTY_SET );
        project.setDependencyArtifacts( Collections.EMPTY_SET );
        File bundleFile = getTestFile( "src/test/resources/org.apache.maven.maven-model_2.1.0.SNAPSHOT.jar" );
        artifact.setFile( bundleFile );

        BundleInfo bundleInfo = plugin.bundle( project );
View Full Code Here


    {
        File osgiBundleFile = getTestBundle();

        assertTrue( osgiBundleFile.exists() );

        MavenProject project = getMavenProjectStub();

        //        PackageVersionAnalyzer analyzer = new PackageVersionAnalyzer();
        Builder analyzer = new Builder();
        Jar jar = new Jar( "name", osgiBundleFile );
        analyzer.setJar( jar );
View Full Code Here

        final Organization organization = new Organization();
        organization.setName( "Example Organization" );
        organization.setUrl( "http://example.org" );

        // MavenProjectStub.setOrganization(Organization) doesn't do anything, so we have to make it work this way
        MavenProject project = new MavenProjectStub()
        {
            @Override
            public Organization getOrganization()
            {
                return organization;
            }
        };
        project.setGroupId( "group" );
        project.setArtifactId( "project" );
        project.setVersion( "1.2.3.4" );

        Properties properties = plugin.getDefaultProperties( project );
        assertEquals( organization.getName(), properties.getProperty( "project.organization.name" ) );
        assertEquals( organization.getName(), properties.getProperty( "pom.organization.name" ) );
        assertEquals( organization.getUrl(), properties.getProperty( "project.organization.url" ) );
View Full Code Here

    }


    public void testPackageInfoDetection() throws Exception
    {
        MavenProject project = getMavenProjectStub();
        project.addCompileSourceRoot( getBasedir() + "/src/test/java" );

        String resourcePaths = plugin.getMavenResourcePaths( project, false );

        assertEquals( "org/apache/felix/bundleplugin/packageinfo="
            + "src/test/java/org/apache/felix/bundleplugin/packageinfo", resourcePaths );
View Full Code Here

        artifacts.addAll( artifactFactory.getClassifiedArtifacts() );
        artifacts.addAll( artifactFactory.getScopedArtifacts() );
        artifacts.addAll( artifactFactory.getTypedArtifacts() );

        MavenProject project = getMavenProjectStub();
        project.setDependencyArtifacts( artifacts );

        Map instructions = new HashMap();
        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "*;classifier=;type=jar;scope=compile,"
            + "*;classifier=;type=jar;scope=runtime" );
        Properties props = new Properties();
View Full Code Here

        artifacts.addAll( artifactFactory.getClassifiedArtifacts() );
        artifacts.addAll( artifactFactory.getScopedArtifacts() );
        artifacts.addAll( artifactFactory.getTypedArtifacts() );

        MavenProject project = getMavenProjectStub();
        project.setDependencyArtifacts( artifacts );

        Map instructions = new HashMap();
        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "!type=jar, !artifactId=c" );
        Properties props = new Properties();
View Full Code Here

        artifacts.addAll( artifactFactory.getClassifiedArtifacts() );
        artifacts.addAll( artifactFactory.getScopedArtifacts() );
        artifacts.addAll( artifactFactory.getTypedArtifacts() );

        MavenProject project = getMavenProjectStub();
        project.setDependencyArtifacts( artifacts );

        Map instructions = new HashMap();
        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "c;type=jar,c;type=sources" );
        Properties props = new Properties();
View Full Code Here

        artifacts.addAll( artifactFactory.getClassifiedArtifacts() );
        artifacts.addAll( artifactFactory.getScopedArtifacts() );
        artifacts.addAll( artifactFactory.getTypedArtifacts() );

        MavenProject project = getMavenProjectStub();
        project.setDependencyArtifacts( artifacts );

        Map instructions = new HashMap();
        instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "artifactId=a|b" );
        Properties props = new Properties();
View Full Code Here

        artifacts.addAll( artifactFactory.getClassifiedArtifacts() );
        artifacts.addAll( artifactFactory.getScopedArtifacts() );
        artifacts.addAll( artifactFactory.getTypedArtifacts() );

        MavenProject project = getMavenProjectStub();
        project.setDependencyArtifacts( artifacts );
        Properties props = new Properties();

        Map instructions1 = new HashMap();
        instructions1.put( DependencyEmbedder.EMBED_DEPENDENCY, "!scope=compile" );
        Builder builder1 = plugin.buildOSGiBundle( project, instructions1, props, plugin.getClasspath( project ) );
View Full Code Here

    }


    public void testPropertySanitizing() throws Exception
    {
        MavenProject project = getMavenProjectStub();

        Properties props = new Properties();

        props.put( new File( "A" ), new File( "B" ) );
        props.put( new int[4], new HashMap( 2 ) );
View Full Code Here

TOP

Related Classes of org.apache.maven.project.MavenProject

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.