Examples of IMavenProjectFacade


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

    }

    public void testTychoLifecycleMapping_EclipseTestPlugin()
        throws Exception
    {
        IMavenProjectFacade facade =
            importProjectAndAssertLifecycleMappingType( "projects/lifecyclemapping",
                                                        "tycho-eclipse-test-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

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

    }

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

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.FEATURE_NATURE ) );
    }
View Full Code Here

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

    }

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

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.SITE_NATURE ) );
    }
View Full Code Here

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

    }

    public void testUpdateWhenJarInClasspath_EclipsePlugin()
        throws Exception
    {
        IMavenProjectFacade facade =
            importProjectAndAssertLifecycleMappingType( "projects/local-jar-classpath", "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

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

  private void setProjectConfiguration(
      ILaunchConfigurationWorkingCopy workingCopy, IContainer basedir) {
    IMavenProjectRegistry projectRegistry = MavenPlugin.getMavenProjectRegistry();
    IFile pomFile = basedir
        .getFile(new Path(IMavenConstants.POM_FILE_NAME));
    IMavenProjectFacade projectFacade = projectRegistry.create(pomFile,
        false, new NullProgressMonitor());
    if (projectFacade != null) {
      ResolverConfiguration configuration = projectFacade
          .getResolverConfiguration();

      String activeProfiles = configuration.getActiveProfiles();
      if (activeProfiles != null && activeProfiles.length() > 0) {
        workingCopy.setAttribute(MavenLaunchConstants.ATTR_PROFILES,
View Full Code Here

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

    return false;
  }

   
  private boolean isPomModified() {
    IMavenProjectFacade facade = getMavenProjectFacade();
    IResourceDelta delta = getDelta(facade.getProject());
    if (delta == null) {
      return false;
    }

    if (delta.findMember(facade.getPom().getProjectRelativePath()) != null) {
      return true;
    }
    return false;
  }
View Full Code Here

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

  }

  private Xpp3Dom customize(Xpp3Dom originalConfiguration, Collection<File> contextFolders,
      File originalDestinationFolder, File originalJsDestinationFolder,
      File originalCssDestinationFolder, File originalGroupNameMappingFile) throws IOException, CoreException {
    IMavenProjectFacade facade = getMavenProjectFacade();
    if (!"war".equals(facade.getPackaging())) {
      // Not a war project, we don't know how to customize that
      return originalConfiguration;
    }
    Xpp3Dom customConfiguration = new Xpp3Dom("configuration");
    Xpp3DomUtils.mergeXpp3Dom(customConfiguration, originalConfiguration);

    IProject project = facade.getProject();
    String target = facade.getMavenProject().getBuild().getDirectory();
    IPath relativeTargetPath = MavenProjectUtils.getProjectRelativePath(project, target);
    if (relativeTargetPath == null) {
      // target folder not under the project directory, we bail
      return customConfiguration;
    }

    IFolder m2eWtpFolder = project.getFolder(relativeTargetPath.append("m2e-wtp"));
    
    if (!m2eWtpFolder.exists() || isWtpIntegrationDisabled(facade.getMavenProject(new NullProgressMonitor()))) {
      // Not a m2e-wtp project, we don't know how to customize either
      // TODO Try to support Sonatype's webby instead?
      return customConfiguration;
    }
    IFolder webResourcesFolder = m2eWtpFolder.getFolder("web-resources");

    IPath fullTargetPath = new Path(target);
    IPath defaultOutputPathPrefix = fullTargetPath.append(facade.getMavenProject().getBuild().getFinalName());

    fixContextFolders(customConfiguration, contextFolders);

    customizeLocation(originalDestinationFolder, webResourcesFolder,
        defaultOutputPathPrefix, customConfiguration, DESTINATION_FOLDER);
View Full Code Here

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

   * having a MET-INF/web-fragment.xml file in their output build directory (or any of their resource folders)
   * If a previous utility facet was installed, it's removed before setting the Web Fragment facet.
   */
  @Override
  public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
    IMavenProjectFacade facade = request.getMavenProjectFacade();
    IProject project = facade.getProject();

    if(WTPProjectsUtil.isM2eWtpDisabled(facade, monitor) || !project.isAccessible() ||
        project.getResourceAttributes().isReadOnly() || !isQualifiedAsWebFragment(facade)){
      return;
    }
View Full Code Here

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

    IFacetedProject facetedProject = ProjectFacetsManager.create(project, true, monitor);

    Set<Action> actions = new LinkedHashSet<Action>();
    installJavaFacet(actions, project, facetedProject);

    IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().create(project.getFile(IMavenConstants.POM_FILE_NAME), true, monitor);
    //Reading content directory, used by WTP to create META-INF/manifest.mf, application-client.xml
    AcrPluginConfiguration config = new AcrPluginConfiguration(facade);
    String contentDir = config.getContentDirectory(project);
    IProjectFacetVersion fv = config.getFacetVersion();
   
View Full Code Here

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

  }
 
  @Override
  public void mavenProjectChanged(MavenProjectChangedEvent event,
      IProgressMonitor monitor) throws CoreException {
    IMavenProjectFacade facade = event.getMavenProject();
      if(facade != null) {
        IProject project = facade.getProject();
        MavenProject mavenProject = facade.getMavenProject(monitor);
        if(isWTPProject(project) && WAR_PACKAGING.equals(mavenProject.getPackaging())) {
        IMavenProjectFacade oldFacade = event.getOldMavenProject();
        if (oldFacade != null) {
          MavenProject oldProject = oldFacade.getMavenProject(monitor);
          if (oldProject != null && oldProject.getArtifacts().equals(mavenProject.getArtifacts())) {
            //Nothing changed since last build, no need to lookup for new Facets
            return;
          }
        }
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.