Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/DisableNatureAction.java =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/DisableNatureAction.java (revision 146) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/DisableNatureAction.java (working copy) @@ -1,24 +1,16 @@ package org.maven.ide.eclipse.actions; -import java.util.ArrayList; import java.util.Iterator; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IObjectActionDelegate; import org.eclipse.ui.IWorkbenchPart; -import org.maven.ide.eclipse.Maven2Plugin; -import org.maven.ide.eclipse.container.Maven2ClasspathContainer; +import org.maven.ide.eclipse.project.MavenEclipseProject; public class DisableNatureAction implements IObjectActionDelegate { @@ -42,7 +34,7 @@ project = (IProject) ((IAdaptable) element).getAdapter(IProject.class); } if(project != null) { - disableNature(project, structuredSelection.size() == 1); + MavenEclipseProject.enableNature(project); } } } @@ -66,39 +58,4 @@ this.targetPart = targetPart; } - private void disableNature(IProject project, boolean isSingle) { - try { - project.deleteMarkers(Maven2Plugin.MARKER_ID, true, IResource.DEPTH_INFINITE); - - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - ArrayList newNatures = new ArrayList(); - for(int i = 0; i < natures.length; ++i) { - if(!Maven2Plugin.NATURE_ID.equals(natures[i])) { - newNatures.add(natures[i]); - } - } - description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); - project.setDescription(description, null); - - IJavaProject javaProject = JavaCore.create(project); - if(javaProject != null) { - // remove classpatch container from JavaProject - IClasspathEntry[] entries = javaProject.getRawClasspath(); - ArrayList newEntries = new ArrayList(); - for(int i = 0; i < entries.length; i++ ) { - if(!Maven2ClasspathContainer.isMaven2ClasspathContainer(entries[i].getPath())) { - newEntries.add(entries[i]); - } - } - javaProject.setRawClasspath((IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]), null); - } - - } catch(CoreException ex) { - Maven2Plugin.getDefault().getConsole().logError("Can't disable nature " + ex.toString()); - Maven2Plugin.log(ex); - - } - } - } Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/EnableNatureAction.java =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/EnableNatureAction.java (revision 146) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/EnableNatureAction.java (working copy) @@ -1,20 +1,11 @@ package org.maven.ide.eclipse.actions; -import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.IClasspathContainer; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -25,8 +16,7 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPart; import org.maven.ide.eclipse.Maven2Plugin; -import org.maven.ide.eclipse.container.Maven2ClasspathContainer; -import org.maven.ide.eclipse.container.Maven2ClasspathContainerInitializer; +import org.maven.ide.eclipse.project.MavenEclipseProject; import org.maven.ide.eclipse.wizards.Maven2PomWizard; @@ -37,19 +27,19 @@ * (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ - public void run( IAction action) { - if( selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = ( IStructuredSelection) selection; - for( Iterator it = structuredSelection.iterator(); it.hasNext();) { + public void run(IAction action) { + if(selection instanceof IStructuredSelection) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + for(Iterator it = structuredSelection.iterator(); it.hasNext();) { Object element = it.next(); IProject project = null; - if( element instanceof IProject) { - project = ( IProject) element; - } else if( element instanceof IAdaptable) { - project = ( IProject) (( IAdaptable) element).getAdapter( IProject.class); + if(element instanceof IProject) { + project = (IProject) element; + } else if(element instanceof IAdaptable) { + project = (IProject) ((IAdaptable) element).getAdapter(IProject.class); } - if( project != null) { - enableNature( project, structuredSelection.size()==1); + if(project != null) { + enableNature(project, structuredSelection.size() == 1); } } } @@ -60,7 +50,7 @@ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, * org.eclipse.jface.viewers.ISelection) */ - public void selectionChanged( IAction action, ISelection selection) { + public void selectionChanged(IAction action, ISelection selection) { this.selection = selection; } @@ -69,75 +59,28 @@ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, * org.eclipse.ui.IWorkbenchPart) */ - public void setActivePart( IAction action, IWorkbenchPart targetPart) { + public void setActivePart(IAction action, IWorkbenchPart targetPart) { } - private void enableNature( IProject project, boolean isSingle) { - try { - IFile pom = project.getFile( Maven2Plugin.POM_FILE_NAME); - if( isSingle && !pom.exists()) { - Maven2PomWizard wizard = new Maven2PomWizard(); - - Maven2Plugin plugin = Maven2Plugin.getDefault(); - IWorkbench workbench = plugin.getWorkbench(); - wizard.init(workbench, (IStructuredSelection) selection); - - Shell shell = workbench.getActiveWorkbenchWindow().getShell(); - WizardDialog wizardDialog = new WizardDialog( shell, wizard); - wizardDialog.create(); - wizardDialog.getShell().setText("Create new POM"); - if(wizardDialog.open()==Window.CANCEL) { - return; - } - } + private void enableNature(IProject project, boolean isSingle) { + IFile pom = project.getFile(Maven2Plugin.POM_FILE_NAME); + if(isSingle && !pom.exists()) { + Maven2PomWizard wizard = new Maven2PomWizard(); - - - ArrayList newNatures = new ArrayList(); - newNatures.add(JavaCore.NATURE_ID); - newNatures.add(Maven2Plugin.NATURE_ID); - - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - for(int i = 0; i < natures.length; ++i) { - String id = natures[i]; - if(!Maven2Plugin.NATURE_ID.equals(id) && !JavaCore.NATURE_ID.equals(natures[i])) { - newNatures.add(natures[i]); - } - } - description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); - project.setDescription(description, null); - - IJavaProject javaProject = JavaCore.create(project); - if(javaProject!=null) { - IClasspathContainer maven2ClasspathContainer = Maven2ClasspathContainerInitializer.getMaven2ClasspathContainer(javaProject); - IClasspathEntry[] containerEntries = maven2ClasspathContainer.getClasspathEntries(); - HashSet containerEntrySet = new HashSet(); - for(int i = 0; i < containerEntries.length; i++ ) { - containerEntrySet.add(containerEntries[i].getPath().toString()); - } - - // remove classpath container from JavaProject - IClasspathEntry[] entries = javaProject.getRawClasspath(); - ArrayList newEntries = new ArrayList(); - for( int i = 0; i < entries.length; i++) { - IClasspathEntry entry = entries[i]; - if(!Maven2ClasspathContainer.isMaven2ClasspathContainer(entry.getPath()) && - !containerEntrySet.contains(entry.getPath().toString())) { - newEntries.add(entry); - } - } - newEntries.add(JavaCore.newContainerEntry(new Path(Maven2Plugin.CONTAINER_ID))); + Maven2Plugin plugin = Maven2Plugin.getDefault(); + IWorkbench workbench = plugin.getWorkbench(); + wizard.init(workbench, (IStructuredSelection) selection); - javaProject.setRawClasspath((IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]), null); + Shell shell = workbench.getActiveWorkbenchWindow().getShell(); + WizardDialog wizardDialog = new WizardDialog(shell, wizard); + wizardDialog.create(); + wizardDialog.getShell().setText("Create new POM"); + if(wizardDialog.open() == Window.CANCEL) { + return; } - - } catch( CoreException ex) { - Maven2Plugin.getDefault().getConsole().logError( "Can't enable nature "+ex.toString() ); - Maven2Plugin.log(ex); - } + + MavenEclipseProject.enableNature(project); } } - Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/UpdateSourcesAction.java =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/UpdateSourcesAction.java (revision 146) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/actions/UpdateSourcesAction.java (working copy) @@ -1,434 +1,47 @@ package org.maven.ide.eclipse.actions; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.jar.Attributes; -import java.util.jar.JarFile; -import java.util.jar.Manifest; -import org.apache.maven.SettingsConfigurationException; -import org.apache.maven.embedder.MavenEmbedder; -import org.apache.maven.execution.DefaultMavenExecutionRequest; -import org.apache.maven.execution.MavenExecutionRequest; -import org.apache.maven.model.Plugin; -import org.apache.maven.model.Resource; -import org.apache.maven.project.MavenProject; -import org.apache.maven.settings.Settings; - -import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMInstallType; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.jdt.launching.LibraryLocation; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IObjectActionDelegate; import org.eclipse.ui.IWorkbenchPart; -import org.maven.ide.eclipse.Maven2Plugin; -import org.maven.ide.eclipse.MavenEmbedderCallback; -import org.maven.ide.eclipse.PluginConsoleEventMonitor; -import org.maven.ide.eclipse.TransferListenerAdapter; -import org.maven.ide.eclipse.preferences.Maven2PreferenceConstants; +import org.maven.ide.eclipse.project.MavenEclipseProject; public class UpdateSourcesAction implements IObjectActionDelegate { // private IAction action; // private IWorkbenchPart targetPart; private ISelection selection; - - public void setActivePart( IAction action, IWorkbenchPart targetPart ) { + public void setActivePart(IAction action, IWorkbenchPart targetPart) { // this.action = action; // this.targetPart = targetPart; } - public void selectionChanged( IAction action, ISelection selection ) { + public void selectionChanged(IAction action, ISelection selection) { // this.action = action; this.selection = selection; } - - public void run( IAction action ) { - IStructuredSelection structuredSelection = ( IStructuredSelection ) selection; - for( Iterator it = structuredSelection.iterator(); it.hasNext(); ) { + public void run(IAction action) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + for(Iterator it = structuredSelection.iterator(); it.hasNext();) { Object element = it.next(); IProject project = null; - if( element instanceof IProject ) { - project = ( IProject ) element; - } else if( element instanceof IAdaptable ) { - project = ( IProject ) ( ( IAdaptable ) element ).getAdapter( IProject.class ); + if(element instanceof IProject) { + project = (IProject) element; + } else if(element instanceof IAdaptable) { + project = (IProject) ((IAdaptable) element).getAdapter(IProject.class); } - if( project != null ) { - new UpdateSourcesJob( project).schedule(); + if(project != null) { + MavenEclipseProject.scheduleUpdateSources(project); } } } - - private static final class UpdateSourcesJob extends Job implements MavenEmbedderCallback { - private final IProject project; - - private Set sources = new HashSet(); - private List sourceEntries = new ArrayList(); - private Map options = new HashMap(); - - UpdateSourcesJob( IProject project) { - super( "Updating "+project.getName()+" Sources"); - this.project = project; - } - - protected IStatus run( IProgressMonitor monitor ) { - IFile pom = project.getFile(Maven2Plugin.POM_FILE_NAME); - if( !pom.exists()) { - return Status.OK_STATUS; - } - - monitor.beginTask( "Updating sources "+project.getName(), IProgressMonitor.UNKNOWN ); - try { - Maven2Plugin.getDefault().executeInEmbedder(this, monitor); - - // TODO optimize project refresh - monitor.subTask( "Refreshing" ); - project.refreshLocal( IResource.DEPTH_INFINITE, new SubProgressMonitor( monitor, 1) ); - - monitor.subTask( "Configuring Build Path" ); - IJavaProject javaProject = JavaCore.create(project); - - setOption( javaProject, options, JavaCore.COMPILER_COMPLIANCE ); - setOption( javaProject, options, JavaCore.COMPILER_SOURCE); - setOption( javaProject, options, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM); - - String source = ( String ) options.get( JavaCore.COMPILER_SOURCE ); - if(source==null) { - sourceEntries.add( JavaRuntime.getDefaultJREContainerEntry() ); - } else { - sourceEntries.add( getJREContainer( source ) ); - } - - IClasspathEntry[] currentClasspath = javaProject.getRawClasspath(); - for( int i = 0; i < currentClasspath.length; i++ ) { - // Delete all non container (e.g. JRE library) entries. See MNGECLIPSE-9 - IClasspathEntry entry = currentClasspath[i]; - if( entry.getEntryKind()==IClasspathEntry.CPE_CONTAINER ) { - if( !JavaRuntime.JRE_CONTAINER.equals( entry.getPath().segment( 0 ) )) { - sourceEntries.add( entry); - } - } - } - - IClasspathEntry[] entries = ( IClasspathEntry[] ) sourceEntries.toArray( new IClasspathEntry[ sourceEntries.size()]); - javaProject.setRawClasspath(entries, monitor); - - Maven2Plugin.getDefault().getConsole().logMessage("Updated source folders for project "+project.getName()); - - } catch( Exception ex ) { - String msg = "Unable to update source folders "+project.getName()+"; " +ex.toString(); - Maven2Plugin.getDefault().getConsole().logMessage( msg ); - // Maven2Plugin.log( msg, ex); - } finally { - monitor.done(); - } - - return Status.OK_STATUS; - } - - private void setOption( IJavaProject javaProject, Map options, String name ) { - String newValue = ( String ) options.get( name ); - if(newValue==null) { - return; - } - String currentValue = javaProject.getOption( name, false ); - if(!newValue.equals( currentValue )) { - javaProject.setOption( name, newValue ); - } - } - - private IClasspathEntry getJREContainer( String version ) { - int n = VERSIONS.indexOf( version ); - if(n>-1) { - Map jreContainers = getJREContainers(); - for( int i = n; i < VERSIONS.size(); i++ ) { - IClasspathEntry entry = ( IClasspathEntry ) jreContainers.get( version ); - if(entry!=null) { - Maven2Plugin.getDefault().getConsole().logMessage( "JRE compliant to "+version+". "+entry ); - return entry; - } - } - } - IClasspathEntry entry = JavaRuntime.getDefaultJREContainerEntry(); - Maven2Plugin.getDefault().getConsole().logMessage( "No JRE compliant to "+version+". Using default JRE container "+entry ); - return entry; - } - - private Map getJREContainers() { - Map jreContainers = new HashMap(); - - jreContainers.put( getJREVersion( JavaRuntime.getDefaultVMInstall() ), JavaRuntime.getDefaultJREContainerEntry()); - - IVMInstallType[] installTypes = JavaRuntime.getVMInstallTypes(); - for( int i = 0; i < installTypes.length; i++ ) { - IVMInstall[] installs = installTypes[i].getVMInstalls(); - for( int j = 0; j < installs.length; j++ ) { - IVMInstall install = installs[j]; - String version = getJREVersion(install); - if(!jreContainers.containsKey( version )) { - // in Eclipse 3.2 one could use JavaRuntime.newJREContainerPath(install) - IPath jreContainerPath = new Path(JavaRuntime.JRE_CONTAINER) - .append(install.getVMInstallType().getId()) - .append(install.getName()); - jreContainers.put(version, JavaCore.newContainerEntry( jreContainerPath )); - } - } - } - - return jreContainers; - } - - private String getJREVersion( IVMInstall install ) { - LibraryLocation[] libraryLocations = JavaRuntime.getLibraryLocations( install ); - if( libraryLocations != null ) { - for( int k = 0; k < libraryLocations.length; k++ ) { - IPath path = libraryLocations[k].getSystemLibraryPath(); - String jarName = path.lastSegment(); - if( "rt.jar".equals( jarName ) ) { - try { - JarFile jarFile = new JarFile( path.toFile() ); - Manifest manifest = jarFile.getManifest(); - Attributes attributes = manifest.getMainAttributes(); - return attributes.getValue( Attributes.Name.SPECIFICATION_VERSION ); - } catch( Exception ex ) { - Maven2Plugin.getDefault().getConsole().logError( "Unable to read "+path+" "+ex.getMessage() ); - } - } - } - } - return null; - } - - /** - * @see MavenEmbedderCallback#run(MavenEmbedder, IProgressMonitor) - */ - public Object run( MavenEmbedder mavenEmbedder, IProgressMonitor monitor ) { - resolve( project.getFile(Maven2Plugin.POM_FILE_NAME), mavenEmbedder, monitor ); - return null; - } - - private void resolve( IResource pomResource, MavenEmbedder mavenEmbedder, IProgressMonitor monitor ) { - if(monitor.isCanceled()) { - throw new OperationCanceledException(); - } - - Maven2Plugin plugin = Maven2Plugin.getDefault(); - - String msg = "Reading "+pomResource.getFullPath(); - plugin.getConsole().logMessage( msg); - - monitor.subTask( "Reading "+pomResource.getFullPath() ); - File pomFile = pomResource.getLocation().toFile(); - - MavenProject mavenProject; - try { - mavenProject = mavenEmbedder.readProject(pomFile); - } catch( Exception ex) { - plugin.getConsole().logError("Unable to read project "+pomResource.getFullPath()+"; "+ex.toString()); - return; - } - - String source = getBuildOption( mavenProject, "maven-compiler-plugin", "source" ); - if(source!=null) { - plugin.getConsole().logMessage( "Setting source compatibility: "+source ); - setVersion( options, JavaCore.COMPILER_SOURCE, source); - setVersion( options, JavaCore.COMPILER_COMPLIANCE, source ); - } - - String target = getBuildOption( mavenProject, "maven-compiler-plugin", "target" ); - if(target!=null) { - plugin.getConsole().logMessage( "Setting target compatibility: "+source ); - setVersion( options, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, target ); - } - - monitor.subTask( "Generating Sources "+pomResource.getFullPath() ); - try { - plugin.getConsole().logMessage("Generating sources "+pomResource.getFullPath()); - - mavenEmbedder.execute( getExecutionRequest(pomFile, monitor, mavenEmbedder) ); - // TODO hook up console view - // EventMonitor eventMonitor = new PluginConsoleEventMonitor(); - // mavenEmbedder.execute(mavenProject, goals, eventMonitor, transferListener, properties, f.getParentFile()); - - } catch( Exception ex ) { - plugin.getConsole().logError("Failed to run generate source goals "+pomResource.getFullPath()+" "+ex.getMessage()); - } - - File basedir = pomResource.getLocation().toFile().getParentFile(); - File projectBaseDir = project.getLocation().toFile(); - - extractSourceDirs(project, mavenProject.getCompileSourceRoots(), basedir, projectBaseDir); - extractSourceDirs(project, mavenProject.getTestCompileSourceRoots(), basedir, projectBaseDir); - - extractResourceDirs(project, mavenProject.getBuild().getResources(), basedir, projectBaseDir); - extractResourceDirs(project, mavenProject.getBuild().getTestResources(), basedir, projectBaseDir); - - IContainer parent = pomResource.getParent(); - List modules = mavenProject.getModules(); - for( Iterator it = modules.iterator(); it.hasNext() && !monitor.isCanceled(); ) { - if(monitor.isCanceled()) { - throw new OperationCanceledException(); - } - String module = ( String ) it.next(); - IResource memberPom = parent.findMember( module+"/"+Maven2Plugin.POM_FILE_NAME); //$NON-NLS-1$ - if(memberPom!=null) { - resolve(memberPom, mavenEmbedder, monitor); - } - } - } - - - private MavenExecutionRequest getExecutionRequest(File pomFile, IProgressMonitor monitor, MavenEmbedder embedder) throws SettingsConfigurationException { - List goals = Arrays.asList( "generate-sources,generate-resources,generate-test-sources,generate-test-resources".split(",")); - - Properties properties = new Properties(); - - File userSettingsPath = embedder.getUserSettingsPath( null ); - File globalSettingsFile = embedder.getGlobalSettingsPath(); - - Settings settings = embedder.buildSettings( - userSettingsPath, - globalSettingsFile, - false, // interactive - false, // offline, - false, // usePluginRegistry, - Boolean.FALSE); // pluginUpdateOverride ); - - String localRepositoryPath = System.getProperty(Maven2PreferenceConstants.P_LOCAL_REPOSITORY_DIR); - if(localRepositoryPath==null || localRepositoryPath.trim().length()==0) { - localRepositoryPath = embedder.getLocalRepositoryPath( settings ); - } - - MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest() - .setPomFile( pomFile.getAbsolutePath() ) - .setBasedir( pomFile.getParentFile() ) - .setGoals( goals ) - .setSettings( settings ) // TODO - .setProperties( properties ) - .setLocalRepositoryPath( localRepositoryPath ) - .setReactorActive( false ) - .setRecursive( true ) - .setShowErrors( true ) // TODO - .setInteractive( false ) - .setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_INFO ) - .activateDefaultEventMonitor() - .addEventMonitor( new PluginConsoleEventMonitor() ) - .setTransferListener( new TransferListenerAdapter( monitor ) ) - .setFailureBehavior( MavenExecutionRequest.REACTOR_FAIL_AT_END ) - // .addActiveProfiles( activeProfiles ) - // .addInactiveProfiles( inactiveProfiles ) - .setOffline(Boolean.getBoolean(Maven2PreferenceConstants.P_OFFLINE)) - .setGlobalChecksumPolicy(System.getProperty(Maven2PreferenceConstants.P_GLOBAL_CHECKSUM_POLICY)); - // .setUpdateSnapshots( updateSnapshots ) // TODO - ; - - return executionRequest; - } - - - public static final List VERSIONS = Arrays.asList( "1.1,1.2,1.3,1.4,1.5,1.6,1.7".split( "," ) ); - - static void setVersion( Map options, String name, String value ) { - if(value==null) { - return; - } - String current = ( String ) options.get( name ); - if(current==null) { - options.put( name, value ); - } else { - int oldIndex = VERSIONS.indexOf( current ); - int newIndex = VERSIONS.indexOf( value.trim() ); - if(newIndex>oldIndex) { - options.put( name, value ); - } - } - } - - void extractSourceDirs( IProject project, List sourceRoots, File basedir, File projectBaseDir ) { - for( Iterator it = sourceRoots.iterator(); it.hasNext(); ) { - String sourceRoot = ( String ) it.next(); - if( new File( sourceRoot ).isDirectory() ) { - IResource r = project.findMember(toRelativeAndFixSeparator( projectBaseDir, sourceRoot )); - if(r!=null && sources.add( r.getFullPath().toString())) { - sourceEntries.add( JavaCore.newSourceEntry( r.getFullPath() /*, new IPath[] { new Path( "**"+"/.svn/"+"**")} */) ); - Maven2Plugin.getDefault().getConsole().logMessage( "Adding source folder " + r.getFullPath() ); - } - } - } - } - - void extractResourceDirs(IProject project, List resources, File basedir, File projectBaseDir ) { - for( Iterator it = resources.iterator(); it.hasNext(); ) { - Resource resource = ( Resource ) it.next(); - File resourceDirectory = new File( resource.getDirectory() ); - if( resourceDirectory.exists() && resourceDirectory.isDirectory() ) { - IResource r = project.findMember(toRelativeAndFixSeparator( projectBaseDir, resource.getDirectory() )); - if(r!=null && sources.add( r.getFullPath().toString())) { - sourceEntries.add( JavaCore.newSourceEntry( r.getFullPath(), new IPath[] { new Path("**") }, r.getFullPath())); //, new IPath[] { new Path( "**"+"/.svn/"+"**")} ) ); - Maven2Plugin.getDefault().getConsole().logMessage( "Adding resource folder " + r.getFullPath() ); - } - } - } - } - - private String toRelativeAndFixSeparator( File basedir, String absolutePath ) { - String relative; - if( absolutePath.equals( basedir.getAbsolutePath() ) ) { - relative = "."; - } else if( absolutePath.startsWith( basedir.getAbsolutePath() ) ) { - relative = absolutePath.substring( basedir.getAbsolutePath().length() + 1 ); - } else { - relative = absolutePath; - } - return relative.replace( '\\', '/' ); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public static String getBuildOption( MavenProject project, String artifactId, String optionName ) { - for( Iterator it = project.getModel().getBuild().getPlugins().iterator(); it.hasNext(); ) { - Plugin plugin = ( Plugin ) it.next(); - if( artifactId.equals( plugin.getArtifactId() ) ) { - Xpp3Dom o = ( Xpp3Dom ) plugin.getConfiguration(); - if( o != null && o.getChild( optionName ) != null ) { - return o.getChild( optionName ).getValue(); - } - } - } - return null; - } - - } - } - Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/project/MavenEclipseProject.java =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/project/MavenEclipseProject.java (revision 0) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/src/org/maven/ide/eclipse/project/MavenEclipseProject.java (revision 0) @@ -0,0 +1,496 @@ + +package org.maven.ide.eclipse.project; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.jar.Attributes; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +import org.apache.maven.SettingsConfigurationException; +import org.apache.maven.embedder.MavenEmbedder; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.Resource; +import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.Settings; + +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jdt.core.IClasspathContainer; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.launching.IVMInstall; +import org.eclipse.jdt.launching.IVMInstallType; +import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.jdt.launching.LibraryLocation; +import org.maven.ide.eclipse.Maven2Plugin; +import org.maven.ide.eclipse.MavenEmbedderCallback; +import org.maven.ide.eclipse.PluginConsoleEventMonitor; +import org.maven.ide.eclipse.TransferListenerAdapter; +import org.maven.ide.eclipse.container.Maven2ClasspathContainer; +import org.maven.ide.eclipse.container.Maven2ClasspathContainerInitializer; +import org.maven.ide.eclipse.preferences.Maven2PreferenceConstants; + + +/** + * Basic helper class that can be used to enable the Maven tooling on a project and also programatically + * update the source folders for the projects + * + * @author Philip Dodds + */ +public class MavenEclipseProject { + + private static final class UpdateSourcesJob extends Job implements MavenEmbedderCallback { + + private final IProject project; + + private Set sources = new HashSet(); + + private List sourceEntries = new ArrayList(); + + private Map options = new HashMap(); + + UpdateSourcesJob(IProject project) { + super("Updating " + project.getName() + " Sources"); + this.project = project; + } + + protected IStatus run(IProgressMonitor monitor) { + IFile pom = project.getFile(Maven2Plugin.POM_FILE_NAME); + if(!pom.exists()) { + return Status.OK_STATUS; + } + + monitor.beginTask("Updating sources " + project.getName(), IProgressMonitor.UNKNOWN); + try { + Maven2Plugin.getDefault().executeInEmbedder(this, monitor); + + // TODO optimize project refresh + monitor.subTask("Refreshing"); + project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1)); + + monitor.subTask("Configuring Build Path"); + IJavaProject javaProject = JavaCore.create(project); + + setOption(javaProject, options, JavaCore.COMPILER_COMPLIANCE); + setOption(javaProject, options, JavaCore.COMPILER_SOURCE); + setOption(javaProject, options, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM); + + String source = (String) options.get(JavaCore.COMPILER_SOURCE); + if(source == null) { + sourceEntries.add(JavaRuntime.getDefaultJREContainerEntry()); + } else { + sourceEntries.add(getJREContainer(source)); + } + + IClasspathEntry[] currentClasspath = javaProject.getRawClasspath(); + for(int i = 0; i < currentClasspath.length; i++ ) { + // Delete all non container (e.g. JRE library) entries. See MNGECLIPSE-9 + IClasspathEntry entry = currentClasspath[i]; + if(entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { + if(!JavaRuntime.JRE_CONTAINER.equals(entry.getPath().segment(0))) { + sourceEntries.add(entry); + } + } + } + + IClasspathEntry[] entries = (IClasspathEntry[]) sourceEntries + .toArray(new IClasspathEntry[sourceEntries.size()]); + javaProject.setRawClasspath(entries, monitor); + + Maven2Plugin.getDefault().getConsole().logMessage("Updated source folders for project " + project.getName()); + + } catch(Exception ex) { + String msg = "Unable to update source folders " + project.getName() + "; " + ex.toString(); + Maven2Plugin.getDefault().getConsole().logMessage(msg); + // Maven2Plugin.log( msg, ex); + } finally { + monitor.done(); + } + + return Status.OK_STATUS; + } + + private void setOption(IJavaProject javaProject, Map options, String name) { + String newValue = (String) options.get(name); + if(newValue == null) { + return; + } + String currentValue = javaProject.getOption(name, false); + if(!newValue.equals(currentValue)) { + javaProject.setOption(name, newValue); + } + } + + private IClasspathEntry getJREContainer(String version) { + int n = VERSIONS.indexOf(version); + if(n > -1) { + Map jreContainers = getJREContainers(); + for(int i = n; i < VERSIONS.size(); i++ ) { + IClasspathEntry entry = (IClasspathEntry) jreContainers.get(version); + if(entry != null) { + Maven2Plugin.getDefault().getConsole().logMessage("JRE compliant to " + version + ". " + entry); + return entry; + } + } + } + IClasspathEntry entry = JavaRuntime.getDefaultJREContainerEntry(); + Maven2Plugin.getDefault().getConsole().logMessage( + "No JRE compliant to " + version + ". Using default JRE container " + entry); + return entry; + } + + private Map getJREContainers() { + Map jreContainers = new HashMap(); + + jreContainers.put(getJREVersion(JavaRuntime.getDefaultVMInstall()), JavaRuntime.getDefaultJREContainerEntry()); + + IVMInstallType[] installTypes = JavaRuntime.getVMInstallTypes(); + for(int i = 0; i < installTypes.length; i++ ) { + IVMInstall[] installs = installTypes[i].getVMInstalls(); + for(int j = 0; j < installs.length; j++ ) { + IVMInstall install = installs[j]; + String version = getJREVersion(install); + if(!jreContainers.containsKey(version)) { + // in Eclipse 3.2 one could use JavaRuntime.newJREContainerPath(install) + IPath jreContainerPath = new Path(JavaRuntime.JRE_CONTAINER).append(install.getVMInstallType().getId()) + .append(install.getName()); + jreContainers.put(version, JavaCore.newContainerEntry(jreContainerPath)); + } + } + } + + return jreContainers; + } + + private String getJREVersion(IVMInstall install) { + LibraryLocation[] libraryLocations = JavaRuntime.getLibraryLocations(install); + if(libraryLocations != null) { + for(int k = 0; k < libraryLocations.length; k++ ) { + IPath path = libraryLocations[k].getSystemLibraryPath(); + String jarName = path.lastSegment(); + if("rt.jar".equals(jarName)) { + try { + JarFile jarFile = new JarFile(path.toFile()); + Manifest manifest = jarFile.getManifest(); + Attributes attributes = manifest.getMainAttributes(); + return attributes.getValue(Attributes.Name.SPECIFICATION_VERSION); + } catch(Exception ex) { + Maven2Plugin.getDefault().getConsole().logError("Unable to read " + path + " " + ex.getMessage()); + } + } + } + } + return null; + } + + /** + * @see MavenEmbedderCallback#run(MavenEmbedder, IProgressMonitor) + */ + public Object run(MavenEmbedder mavenEmbedder, IProgressMonitor monitor) { + resolve(project.getFile(Maven2Plugin.POM_FILE_NAME), mavenEmbedder, monitor); + return null; + } + + private void resolve(IResource pomResource, MavenEmbedder mavenEmbedder, IProgressMonitor monitor) { + if(monitor.isCanceled()) { + throw new OperationCanceledException(); + } + + Maven2Plugin plugin = Maven2Plugin.getDefault(); + + String msg = "Reading " + pomResource.getFullPath(); + plugin.getConsole().logMessage(msg); + + monitor.subTask("Reading " + pomResource.getFullPath()); + File pomFile = pomResource.getLocation().toFile(); + + MavenProject mavenProject; + try { + mavenProject = mavenEmbedder.readProject(pomFile); + } catch(Exception ex) { + plugin.getConsole().logError("Unable to read project " + pomResource.getFullPath() + "; " + ex.toString()); + return; + } + + String source = getBuildOption(mavenProject, "maven-compiler-plugin", "source"); + if(source != null) { + plugin.getConsole().logMessage("Setting source compatibility: " + source); + setVersion(options, JavaCore.COMPILER_SOURCE, source); + setVersion(options, JavaCore.COMPILER_COMPLIANCE, source); + } + + String target = getBuildOption(mavenProject, "maven-compiler-plugin", "target"); + if(target != null) { + plugin.getConsole().logMessage("Setting target compatibility: " + source); + setVersion(options, JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, target); + } + + monitor.subTask("Generating Sources " + pomResource.getFullPath()); + try { + plugin.getConsole().logMessage("Generating sources " + pomResource.getFullPath()); + + mavenEmbedder.execute(getExecutionRequest(pomFile, monitor, mavenEmbedder)); + // TODO hook up console view + // EventMonitor eventMonitor = new PluginConsoleEventMonitor(); + // mavenEmbedder.execute(mavenProject, goals, eventMonitor, transferListener, properties, f.getParentFile()); + + } catch(Exception ex) { + plugin.getConsole().logError( + "Failed to run generate source goals " + pomResource.getFullPath() + " " + ex.getMessage()); + } + + File basedir = pomResource.getLocation().toFile().getParentFile(); + File projectBaseDir = project.getLocation().toFile(); + + extractSourceDirs(project, mavenProject.getCompileSourceRoots(), basedir, projectBaseDir); + extractSourceDirs(project, mavenProject.getTestCompileSourceRoots(), basedir, projectBaseDir); + + extractResourceDirs(project, mavenProject.getBuild().getResources(), basedir, projectBaseDir); + extractResourceDirs(project, mavenProject.getBuild().getTestResources(), basedir, projectBaseDir); + + IContainer parent = pomResource.getParent(); + List modules = mavenProject.getModules(); + for(Iterator it = modules.iterator(); it.hasNext() && !monitor.isCanceled();) { + if(monitor.isCanceled()) { + throw new OperationCanceledException(); + } + String module = (String) it.next(); + IResource memberPom = parent.findMember(module + "/" + Maven2Plugin.POM_FILE_NAME); //$NON-NLS-1$ + if(memberPom != null) { + resolve(memberPom, mavenEmbedder, monitor); + } + } + } + + private MavenExecutionRequest getExecutionRequest(File pomFile, IProgressMonitor monitor, MavenEmbedder embedder) + throws SettingsConfigurationException { + List goals = Arrays.asList("generate-sources,generate-resources,generate-test-sources,generate-test-resources" + .split(",")); + + Properties properties = new Properties(); + + File userSettingsPath = embedder.getUserSettingsPath(null); + File globalSettingsFile = embedder.getGlobalSettingsPath(); + + Settings settings = embedder.buildSettings(userSettingsPath, globalSettingsFile, false, // interactive + false, // offline, + false, // usePluginRegistry, + Boolean.FALSE); // pluginUpdateOverride ); + + String localRepositoryPath = System.getProperty(Maven2PreferenceConstants.P_LOCAL_REPOSITORY_DIR); + if(localRepositoryPath == null || localRepositoryPath.trim().length() == 0) { + localRepositoryPath = embedder.getLocalRepositoryPath(settings); + } + + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest().setPomFile(pomFile.getAbsolutePath()) + .setBasedir(pomFile.getParentFile()).setGoals(goals).setSettings(settings) + // TODO + .setProperties(properties).setLocalRepositoryPath(localRepositoryPath).setReactorActive(false).setRecursive( + true).setShowErrors(true) + // TODO + .setInteractive(false).setLoggingLevel(MavenExecutionRequest.LOGGING_LEVEL_INFO) + .activateDefaultEventMonitor().addEventMonitor(new PluginConsoleEventMonitor()).setTransferListener( + new TransferListenerAdapter(monitor)).setFailureBehavior(MavenExecutionRequest.REACTOR_FAIL_AT_END) + // .addActiveProfiles( activeProfiles ) + // .addInactiveProfiles( inactiveProfiles ) + .setOffline(Boolean.getBoolean(Maven2PreferenceConstants.P_OFFLINE)).setGlobalChecksumPolicy( + System.getProperty(Maven2PreferenceConstants.P_GLOBAL_CHECKSUM_POLICY)); + // .setUpdateSnapshots( updateSnapshots ) // TODO + ; + + return executionRequest; + } + + public static final List VERSIONS = Arrays.asList("1.1,1.2,1.3,1.4,1.5,1.6,1.7".split(",")); + + static void setVersion(Map options, String name, String value) { + if(value == null) { + return; + } + String current = (String) options.get(name); + if(current == null) { + options.put(name, value); + } else { + int oldIndex = VERSIONS.indexOf(current); + int newIndex = VERSIONS.indexOf(value.trim()); + if(newIndex > oldIndex) { + options.put(name, value); + } + } + } + + void extractSourceDirs(IProject project, List sourceRoots, File basedir, File projectBaseDir) { + for(Iterator it = sourceRoots.iterator(); it.hasNext();) { + String sourceRoot = (String) it.next(); + if(new File(sourceRoot).isDirectory()) { + IResource r = project.findMember(toRelativeAndFixSeparator(projectBaseDir, sourceRoot)); + if(r != null && sources.add(r.getFullPath().toString())) { + sourceEntries.add(JavaCore + .newSourceEntry(r.getFullPath() /*, new IPath[] { new Path( "**"+"/.svn/"+"**")} */)); + Maven2Plugin.getDefault().getConsole().logMessage("Adding source folder " + r.getFullPath()); + } + } + } + } + + void extractResourceDirs(IProject project, List resources, File basedir, File projectBaseDir) { + for(Iterator it = resources.iterator(); it.hasNext();) { + Resource resource = (Resource) it.next(); + File resourceDirectory = new File(resource.getDirectory()); + if(resourceDirectory.exists() && resourceDirectory.isDirectory()) { + IResource r = project.findMember(toRelativeAndFixSeparator(projectBaseDir, resource.getDirectory())); + if(r != null && sources.add(r.getFullPath().toString())) { + sourceEntries.add(JavaCore.newSourceEntry(r.getFullPath(), new IPath[] {new Path("**")}, r.getFullPath())); //, new IPath[] { new Path( "**"+"/.svn/"+"**")} ) ); + Maven2Plugin.getDefault().getConsole().logMessage("Adding resource folder " + r.getFullPath()); + } + } + } + } + + private String toRelativeAndFixSeparator(File basedir, String absolutePath) { + String relative; + if(absolutePath.equals(basedir.getAbsolutePath())) { + relative = "."; + } else if(absolutePath.startsWith(basedir.getAbsolutePath())) { + relative = absolutePath.substring(basedir.getAbsolutePath().length() + 1); + } else { + relative = absolutePath; + } + return relative.replace('\\', '/'); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public static String getBuildOption(MavenProject project, String artifactId, String optionName) { + for(Iterator it = project.getModel().getBuild().getPlugins().iterator(); it.hasNext();) { + Plugin plugin = (Plugin) it.next(); + if(artifactId.equals(plugin.getArtifactId())) { + Xpp3Dom o = (Xpp3Dom) plugin.getConfiguration(); + if(o != null && o.getChild(optionName) != null) { + return o.getChild(optionName).getValue(); + } + } + } + return null; + } + + } + + public static void scheduleUpdateSources(IProject project) { + new UpdateSourcesJob(project).schedule(); + } + + public static void updateSources(IProject project) throws InterruptedException { + UpdateSourcesJob job = new UpdateSourcesJob(project); + job.schedule(); + job.join(); + } + + public static void enableNature(IProject project) { + try { + ArrayList newNatures = new ArrayList(); + newNatures.add(JavaCore.NATURE_ID); + newNatures.add(Maven2Plugin.NATURE_ID); + + IProjectDescription description = project.getDescription(); + String[] natures = description.getNatureIds(); + for(int i = 0; i < natures.length; ++i) { + String id = natures[i]; + if(!Maven2Plugin.NATURE_ID.equals(id) && !JavaCore.NATURE_ID.equals(natures[i])) { + newNatures.add(natures[i]); + } + } + description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); + project.setDescription(description, null); + + IJavaProject javaProject = JavaCore.create(project); + if(javaProject != null) { + IClasspathContainer maven2ClasspathContainer = Maven2ClasspathContainerInitializer + .getMaven2ClasspathContainer(javaProject); + IClasspathEntry[] containerEntries = maven2ClasspathContainer.getClasspathEntries(); + HashSet containerEntrySet = new HashSet(); + for(int i = 0; i < containerEntries.length; i++ ) { + containerEntrySet.add(containerEntries[i].getPath().toString()); + } + + // remove classpath container from JavaProject + IClasspathEntry[] entries = javaProject.getRawClasspath(); + ArrayList newEntries = new ArrayList(); + for(int i = 0; i < entries.length; i++ ) { + IClasspathEntry entry = entries[i]; + if(!Maven2ClasspathContainer.isMaven2ClasspathContainer(entry.getPath()) + && !containerEntrySet.contains(entry.getPath().toString())) { + newEntries.add(entry); + } + } + newEntries.add(JavaCore.newContainerEntry(new Path(Maven2Plugin.CONTAINER_ID))); + + javaProject.setRawClasspath((IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]), + null); + } + + } catch(CoreException ex) { + Maven2Plugin.getDefault().getConsole().logError("Can't enable nature " + ex.toString()); + Maven2Plugin.log(ex); + + } + } + + public static void disableNature(IProject project) { + try { + project.deleteMarkers(Maven2Plugin.MARKER_ID, true, IResource.DEPTH_INFINITE); + + IProjectDescription description = project.getDescription(); + String[] natures = description.getNatureIds(); + ArrayList newNatures = new ArrayList(); + for(int i = 0; i < natures.length; ++i) { + if(!Maven2Plugin.NATURE_ID.equals(natures[i])) { + newNatures.add(natures[i]); + } + } + description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); + project.setDescription(description, null); + + IJavaProject javaProject = JavaCore.create(project); + if(javaProject != null) { + // remove classpatch container from JavaProject + IClasspathEntry[] entries = javaProject.getRawClasspath(); + ArrayList newEntries = new ArrayList(); + for(int i = 0; i < entries.length; i++ ) { + if(!Maven2ClasspathContainer.isMaven2ClasspathContainer(entries[i].getPath())) { + newEntries.add(entries[i]); + } + } + javaProject.setRawClasspath((IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]), + null); + } + + } catch(CoreException ex) { + Maven2Plugin.getDefault().getConsole().logError("Can't disable nature " + ex.toString()); + Maven2Plugin.log(ex); + } + } +} Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/build.xml =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/build.xml (revision 0) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/build.xml (revision 0) @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/META-INF/MANIFEST.MF =================================================================== --- C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/META-INF/MANIFEST.MF (revision 146) +++ C:/dev/workspaces/fuse-tooling/org.maven.ide.eclipse/META-INF/MANIFEST.MF (working copy) @@ -29,3 +29,6 @@ Bundle-ClassPath: m2plugin.jar, lib/lucene-core-2.0.0.jar, lib/maven-embedder-2.1-20060530210557-dep.jar +Export-Package: org.maven.ide.eclipse, + org.maven.ide.eclipse.launch, + org.maven.ide.eclipse.project