Examples of IOverlayVirtualComponent


Examples of org.eclipse.m2e.wtp.overlay.modulecore.IOverlayVirtualComponent

        if (overlay.shouldSkip()) {
          continue;
        }
       
        Artifact artifact = overlay.getArtifact();
        IOverlayVirtualComponent overlayComponent = null;
        IMavenProjectFacade workspaceDependency = projectManager.getMavenProject(
            artifact.getGroupId(),
            artifact.getArtifactId(),
            artifact.getVersion());

        if(workspaceDependency != null) {
          //artifact dependency is a workspace project && dependency resolution is on
          IProject overlayProject = workspaceDependency.getProject();

          if (overlayProject.equals(project)) {
            overlayComponent = OverlayComponentCore.createSelfOverlayComponent(project);
          } else if (workspaceDependency.getFullPath(artifact.getFile()) != null){
            overlayComponent = OverlayComponentCore.createOverlayComponent(overlayProject);
          } else {
            //Dependency resolution is off
            overlayComponent = createOverlayArchiveComponent(project, mavenProject, overlay);
          }
        } else {
          overlayComponent = createOverlayArchiveComponent(project, mavenProject, overlay);
        }

        if (overlayComponent != null) {
         
          overlayComponent.setInclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getIncludes())));
          overlayComponent.setExclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getExcludes())));
         
          IVirtualReference depRef = ComponentCore.createReference(warComponent, overlayComponent);
          String targetPath = StringUtils.nullOrEmpty(overlay.getTargetPath())?"/":overlay.getTargetPath(); //$NON-NLS-1$
          depRef.setRuntimePath(new Path(targetPath));
          newOverlayRefs.add(depRef);
View Full Code Here

Examples of org.eclipse.m2e.wtp.overlay.modulecore.IOverlayVirtualComponent

  private IOverlayVirtualComponent createOverlayArchiveComponent(IProject project, MavenProject mavenProject, Overlay overlay) throws CoreException {
    IPath m2eWtpFolder = ProjectUtils.getM2eclipseWtpFolder(mavenProject, project);
    IPath unpackDirPath = new Path(m2eWtpFolder.toOSString()+"/overlays"); //$NON-NLS-1$
    String archiveLocation = ArtifactHelper.getM2REPOVarPath(overlay.getArtifact());
    String targetPath = StringUtils.nullOrEmpty(overlay.getTargetPath())?"/":overlay.getTargetPath(); //$NON-NLS-1$
    IOverlayVirtualComponent component = OverlayComponentCore.createOverlayArchiveComponent(
                                                                project,
                                                                archiveLocation,
                                                                unpackDirPath,
                                                                new Path(targetPath));
    return component;
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.