public class BuildPathManager extends Object implements IMavenProjectChangedListener, org.eclipse.core.resources.IResourceChangeListener, IClasspathManager
Modifier and Type | Field and Description |
---|---|
static String |
CLASSIFIER_JAVADOC |
static String |
CLASSIFIER_SOURCES |
static String |
CLASSIFIER_TESTS |
static String |
CLASSIFIER_TESTSOURCES |
static String |
M2_REPO |
static org.apache.maven.artifact.resolver.filter.ArtifactFilter |
SCOPE_FILTER_RUNTIME |
static org.apache.maven.artifact.resolver.filter.ArtifactFilter |
SCOPE_FILTER_TEST |
ARTIFACT_ID_ATTRIBUTE, CLASSIFIER_ATTRIBUTE, CLASSPATH_DEFAULT, CLASSPATH_RUNTIME, CLASSPATH_TEST, CONTAINER_ID, GROUP_ID_ATTRIBUTE, OPTIONALDEPENDENCY_ATTRIBUTE, POMDERIVED_ATTRIBUTE, SCOPE_ATTRIBUTE, VERSION_ATTRIBUTE
Constructor and Description |
---|
BuildPathManager(IMavenProjectRegistry projectManager,
IndexManager indexManager,
org.osgi.framework.BundleContext bundleContext,
File stateLocationDir) |
Modifier and Type | Method and Description |
---|---|
ArtifactKey |
findArtifact(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IPath path) |
org.eclipse.jdt.core.IClasspathEntry[] |
getClasspath(org.eclipse.core.resources.IProject project,
int scope,
boolean uniquePaths,
org.eclipse.core.runtime.IProgressMonitor monitor)
Calculates and returns Maven classpath of the project.
|
org.eclipse.jdt.core.IClasspathEntry[] |
getClasspath(org.eclipse.core.resources.IProject project,
int scope,
org.eclipse.core.runtime.IProgressMonitor monitor) |
org.eclipse.jdt.core.IClasspathEntry[] |
getClasspath(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor) |
File |
getContainerStateFile(org.eclipse.core.resources.IProject project)
public for unit tests only
|
org.eclipse.core.runtime.jobs.Job |
getDownloadSourcesJob()
this is for unit tests only!
|
String |
getJavadocLocation(org.eclipse.jdt.core.IClasspathEntry entry)
public for unit tests only
|
static org.eclipse.jdt.core.IClasspathContainer |
getMaven2ClasspathContainer(org.eclipse.jdt.core.IJavaProject project) |
static org.eclipse.jdt.core.IClasspathEntry |
getMavenContainerEntry(org.eclipse.jdt.core.IJavaProject javaProject) |
org.eclipse.jdt.core.IClasspathContainer |
getSavedContainer(org.eclipse.core.resources.IProject project) |
File |
getSourceAttachmentPropertiesFile(org.eclipse.core.resources.IProject project)
public for unit tests only
|
void |
mavenProjectChanged(MavenProjectChangedEvent[] events,
org.eclipse.core.runtime.IProgressMonitor monitor)
This method is called while holding workspace lock.
|
void |
persistAttachedSourcesAndJavadoc(org.eclipse.jdt.core.IJavaProject project,
org.eclipse.jdt.core.IClasspathContainer containerSuggestion,
org.eclipse.core.runtime.IProgressMonitor monitor)
Extracts and persists custom source/javadoc attachment info
|
void |
resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event) |
void |
scheduleDownload(org.eclipse.jdt.core.IPackageFragmentRoot fragment,
boolean downloadSources,
boolean downloadJavadoc)
Request download of sources and/or javadoc from Maven repositories by a background job (asynchronous execution).
|
void |
scheduleDownload(org.eclipse.core.resources.IProject project,
boolean downloadSources,
boolean downloadJavadoc)
Request download of sources and/or javadoc from Maven repositories by a background job for all classpath entries of
the project (asynchronous execution).
|
boolean |
setupVariables() |
void |
updateClasspath(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Calculates Maven classpath of the project using default dependency resolution scope and updates contents of Maven
Dependencies classpath container.
|
boolean |
variablesAreInUse() |
public static final String M2_REPO
public static final String CLASSIFIER_SOURCES
public static final String CLASSIFIER_JAVADOC
public static final String CLASSIFIER_TESTS
public static final String CLASSIFIER_TESTSOURCES
public static final org.apache.maven.artifact.resolver.filter.ArtifactFilter SCOPE_FILTER_RUNTIME
public static final org.apache.maven.artifact.resolver.filter.ArtifactFilter SCOPE_FILTER_TEST
public BuildPathManager(IMavenProjectRegistry projectManager, IndexManager indexManager, org.osgi.framework.BundleContext bundleContext, File stateLocationDir)
public static org.eclipse.jdt.core.IClasspathEntry getMavenContainerEntry(org.eclipse.jdt.core.IJavaProject javaProject)
public static org.eclipse.jdt.core.IClasspathContainer getMaven2ClasspathContainer(org.eclipse.jdt.core.IJavaProject project) throws org.eclipse.jdt.core.JavaModelException
org.eclipse.jdt.core.JavaModelException
public void mavenProjectChanged(MavenProjectChangedEvent[] events, org.eclipse.core.runtime.IProgressMonitor monitor)
IMavenProjectChangedListener
mavenProjectChanged
in interface IMavenProjectChangedListener
public void updateClasspath(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor)
IClasspathManager
updateClasspath
in interface IClasspathManager
public org.eclipse.jdt.core.IClasspathContainer getSavedContainer(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public org.eclipse.jdt.core.IClasspathEntry[] getClasspath(org.eclipse.core.resources.IProject project, int scope, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public org.eclipse.jdt.core.IClasspathEntry[] getClasspath(org.eclipse.core.resources.IProject project, int scope, boolean uniquePaths, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IClasspathManager
getClasspath
in interface IClasspathManager
project
- the project to calculate classpath forscope
- one of CLASPATH_* constants, that specifies Maven dependency resolution scope for the classpathuniquePaths
- enforce (true) or not to enforce (false) uniqueness of classpath entries paths.monitor
- progress monitororg.eclipse.core.runtime.CoreException
public org.eclipse.jdt.core.IClasspathEntry[] getClasspath(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public ArtifactKey findArtifact(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public void persistAttachedSourcesAndJavadoc(org.eclipse.jdt.core.IJavaProject project, org.eclipse.jdt.core.IClasspathContainer containerSuggestion, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public String getJavadocLocation(org.eclipse.jdt.core.IClasspathEntry entry)
public File getSourceAttachmentPropertiesFile(org.eclipse.core.resources.IProject project)
public File getContainerStateFile(org.eclipse.core.resources.IProject project)
public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
resourceChanged
in interface org.eclipse.core.resources.IResourceChangeListener
public boolean setupVariables()
public boolean variablesAreInUse()
public org.eclipse.core.runtime.jobs.Job getDownloadSourcesJob()
public void scheduleDownload(org.eclipse.jdt.core.IPackageFragmentRoot fragment, boolean downloadSources, boolean downloadJavadoc)
IClasspathManager
scheduleDownload
in interface IClasspathManager
public void scheduleDownload(org.eclipse.core.resources.IProject project, boolean downloadSources, boolean downloadJavadoc)
IClasspathManager
scheduleDownload
in interface IClasspathManager
Copyright © 2005–2015 Sonatype, Inc.. All rights reserved.