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 |
static int |
SOURCE_DOWNLOAD_PRIORITY |
ARTIFACT_ID_ATTRIBUTE, CLASSIFIER_ATTRIBUTE, CLASSPATH_DEFAULT, CLASSPATH_RUNTIME, CLASSPATH_TEST, CONTAINER_ID, GROUP_ID_ATTRIBUTE, OPTIONALDEPENDENCY_ATTRIBUTE, POMDERIVED_ATTRIBUTE, SCOPE_ATTRIBUTE, TEST_ATTRIBUTE, VERSION_ATTRIBUTE, WITHOUT_TEST_CODE| 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) |
String |
getSourceAttachmentEncoding(org.eclipse.jdt.core.IClasspathEntry entry) |
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 int SOURCE_DOWNLOAD_PRIORITY
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.JavaModelExceptionpublic void mavenProjectChanged(MavenProjectChangedEvent[] events, org.eclipse.core.runtime.IProgressMonitor monitor)
IMavenProjectChangedListenermavenProjectChanged in interface IMavenProjectChangedListenerpublic void updateClasspath(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
IClasspathManagerupdateClasspath in interface IClasspathManagerpublic org.eclipse.jdt.core.IClasspathContainer getSavedContainer(org.eclipse.core.resources.IProject project)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreExceptionpublic 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.CoreExceptionpublic 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
IClasspathManagergetClasspath in interface IClasspathManagerproject - 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.CoreExceptionpublic 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.CoreExceptionpublic ArtifactKey findArtifact(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath path) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreExceptionpublic 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.CoreExceptionpublic String getJavadocLocation(org.eclipse.jdt.core.IClasspathEntry entry)
public String getSourceAttachmentEncoding(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.IResourceChangeListenerpublic 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)
IClasspathManagerscheduleDownload in interface IClasspathManagerpublic void scheduleDownload(org.eclipse.core.resources.IProject project,
boolean downloadSources,
boolean downloadJavadoc)
IClasspathManagerscheduleDownload in interface IClasspathManagerCopyright © 2005–2021 Eclipse Foundation. All rights reserved.