Examples of IMavenProjectFacade


Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testDefaultManifestLocation()
        throws Exception
    {
        IMavenProjectFacade facade = importMavenProject( "projects/maven-bundle-plugin/manifestlocation", "pom.xml" );
        assertPDEPluginProject( facade, "target/classes/META-INF/MANIFEST.MF" );

        // make sure no META-INF/MANIFEST.MF
        IFile manifest = facade.getProject().getFile( "META-INF/MANIFEST.MF" );
        manifest.getParent().refreshLocal( IResource.DEPTH_INFINITE, monitor );
        assertFalse( manifest.exists() );
    }
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testEmbedDependency()
        throws Exception
    {
        IMavenProjectFacade maven =
            importMavenProject( "projects/maven-bundle-plugin/embed-dependency/maven", "pom.xml" );
        maven.getProject().build( IncrementalProjectBuilder.FULL_BUILD, monitor );
        workspace.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
        waitForJobsToComplete();

        IPluginModelBase model = PluginRegistry.findModel( maven.getProject() );
        assertNotNull( model );

        IJavaProject javaProject = JavaCore.create( maven.getProject() );
        IClasspathEntry[] cp = javaProject.getRawClasspath();
        IClasspathEntry mavenContainer = getClasspathEntry( cp, new Path( IClasspathManager.CONTAINER_ID ) );
        assertNotNull( mavenContainer );
        assertTrue( mavenContainer.isExported() );

        IProject project = createExisting( "pde", "projects/maven-bundle-plugin/embed-dependency/pde" );

        workspace.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
        workspace.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
        waitForJobsToComplete();

        assertNoErrors( maven.getProject() );
        assertNoErrors( project );
    }
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testManifestGenerationAfterPomChange()
        throws Exception
    {
        IMavenProjectFacade facade = importMavenProject( "projects/maven-bundle-plugin/pom-change", "pom.xml" );

        IProject project = facade.getProject();
        IFile mfile = project.getFile( "META-INF/MANIFEST.MF" );

        assertPDEPluginProject( facade, "META-INF/MANIFEST.MF" );
        assertNoErrors( project );
        Manifest mf = loadManifest( mfile );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testRequestConfigurationUpdateAfterManifestLocationChange()
        throws Exception
    {
        IMavenProjectFacade facade = importMavenProject( "projects/maven-bundle-plugin/pom-change", "pom.xml" );
        IProject project = facade.getProject();

        assertPDEPluginProject( facade, "META-INF/MANIFEST.MF" );
        assertNoErrors( project );

        copyContent( project, new File( "projects/maven-bundle-plugin/pom-change/pom.xml-changed-manifest-location" ),
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testIncludeBndFileChange()
        throws Exception
    {
        IMavenProjectFacade facade = importMavenProject( "projects/maven-bundle-plugin/bnd-file-change", "pom.xml" );
        IProject project = facade.getProject();
        IFile mfile = project.getFile( "META-INF/MANIFEST.MF" );

        assertPDEPluginProject( facade, "META-INF/MANIFEST.MF" );
        assertNoErrors( project );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testMultipleExecutionsErrorMarkers()
        throws Exception
    {
        IMavenProjectFacade facade = importMavenProject( "projects/maven-bundle-plugin/multiple-executions", "pom.xml" );
        IProject[] projects = new IProject[] { facade.getProject() };

        waitForJobsToComplete();
        workspace.build( IncrementalProjectBuilder.FULL_BUILD, monitor );

        ProjectConfigurationManager configurationManager =
            (ProjectConfigurationManager) MavenPlugin.getProjectConfigurationManager();
        MavenUpdateRequest request = new MavenUpdateRequest( projects, false, true );
        configurationManager.updateProjectConfiguration( request, true, true, true, monitor );

        waitForJobsToComplete();

        WorkspaceHelpers.assertErrorMarker( IMavenConstants.MARKER_LIFECYCLEMAPPING_ID,
                                            "Duplicate bundle executions found. Please remove any explicitly defined bundle executions in your pom.xml.",
                                            null, "pom.xml", facade.getProject() );

        // update the pom and recheck that markers are gone
        copyContent( facade.getProject(), new File( "projects/maven-bundle-plugin/multiple-executions/validpom.xml" ),
                     "pom.xml" );

        request = new MavenUpdateRequest( projects, false, true );
        configurationManager.updateProjectConfiguration( request, true, true, true, monitor );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testDeclerativeServices()
        throws Exception
    {
        IMavenProjectFacade facade =
            importMavenProject( "projects/maven-bundle-plugin/declerative-services", "pom.xml" );
        waitForJobsToComplete();
        workspace.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
        assertNoErrors( facade.getProject() );

        IProject project = facade.getProject();
        IFile mfile = project.getFile( "META-INF/MANIFEST.MF" );

        Manifest mf = loadManifest( mfile );
        assertEquals( "OSGI-INF/ds.ServiceImpl.xml", mf.getMainAttributes().getValue( "Service-Component" ) );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testDeclerativeServicesBnd()
        throws Exception
    {
        IMavenProjectFacade facade =
            importMavenProject( "projects/maven-bundle-plugin/declerative-services-bnd", "pom.xml" );
        waitForJobsToComplete();
        workspace.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
        assertNoErrors( facade.getProject() );

        IProject project = facade.getProject();
        IFile mfile = project.getFile( "META-INF/MANIFEST.MF" );

        Manifest mf = loadManifest( mfile );
        assertEquals( "OSGI-INF/ds.ServiceImpl.xml", mf.getMainAttributes().getValue( "Service-Component" ) );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    private IMavenProjectFacade importProjectAndAssertLifecycleMappingType( String basedir, String pomName )
        throws Exception
    {
        assertTrue( new File( basedir, pomName ).exists() );

        IMavenProjectFacade facade = importMavenProject( basedir, pomName );
        assertNotNull( facade );
        WorkspaceHelpers.assertNoErrors( facade.getProject() );
        ILifecycleMapping lifecycleMapping = projectConfigurationManager.getLifecycleMapping( facade );

        assertNotNull( "Expected not null lifecycleMapping", lifecycleMapping );
        assertTrue( lifecycleMapping.getClass().getName(), lifecycleMapping instanceof TychoLifecycleMapping );
View Full Code Here

Examples of org.eclipse.m2e.core.project.IMavenProjectFacade

    }

    public void testTychoLifecycleMapping_EclipsePlugin()
        throws Exception
    {
        IMavenProjectFacade facade =
            importProjectAndAssertLifecycleMappingType( "projects/lifecyclemapping", "tycho-eclipse-plugin/pom.xml" );

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.PLUGIN_NATURE ) );
        assertTrue( project.hasNature( JavaCore.NATURE_ID ) );
        IPluginModelBase model = PluginRegistry.findModel( project );
        assertNotNull( model );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.