1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
/*******************************************************************************
* Copyright (c) 2008-2010 Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.m2e.core.project;
import java.io.File;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.apache.maven.lifecycle.MavenExecutionPlan;
import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.ArtifactRef;
import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
import org.eclipse.m2e.core.internal.project.ProjectConfigurationManager;
import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
/**
* IMavenProjectFacade
*
* @noimplement This interface is not intended to be implemented by clients.
*
* @author Igor Fedorenko
*/
public interface IMavenProjectFacade {
/**
* Returns project relative paths of resource directories
*/
IPath[] getResourceLocations();
/**
* Returns project relative paths of test resource directories
*/
IPath[] getTestResourceLocations();
IPath[] getCompileSourceLocations();
IPath[] getTestCompileSourceLocations();
/**
* Returns project resource for given file system location or null the location is outside of project.
*
* @param resourceLocation absolute file system location
* @return IPath the full, absolute workspace path resourceLocation
*/
IPath getProjectRelativePath(String resourceLocation);
/**
* Returns the full, absolute path of this project maven build output directory relative to the workspace or null if
* maven build output directory cannot be determined or outside of the workspace.
*/
IPath getOutputLocation();
/**
* Returns the full, absolute path of this project maven build test output directory relative to the workspace or null
* if maven build output directory cannot be determined or outside of the workspace.
*/
IPath getTestOutputLocation();
IPath getFullPath();
/**
* Lazy load and cache MavenProject instance
*/
MavenProject getMavenProject(IProgressMonitor monitor) throws CoreException;
/**
* Returns cached MavenProject instance associated with this facade or null,
* if the cache has not been populated yet.
*/
MavenProject getMavenProject();
/**
* Lazy load and cache build execution plan
*/
MavenExecutionPlan getExecutionPlan(IProgressMonitor monitor) throws CoreException;
String getPackaging();
IProject getProject();
IFile getPom();
File getPomFile();
/**
* Returns the full, absolute path of the given file relative to the workspace. Returns null if the file does not
* exist or is not a member of this project.
*/
IPath getFullPath(File file);
/**
* Visits trough Maven project artifacts and modules
*
* @param visitor a project visitor used to visit Maven project
* @param flags flags to specify visiting behavior. See {@link IMavenProjectVisitor#LOAD},
* {@link IMavenProjectVisitor#NESTED_MODULES}.
*/
void accept(IMavenProjectVisitor visitor, int flags) throws CoreException;
void accept(IMavenProjectVisitor2 visitor, int flags, IProgressMonitor monitor) throws CoreException;
List<String> getMavenProjectModules();
Set<ArtifactRef> getMavenProjectArtifacts();
ResolverConfiguration getResolverConfiguration();
/**
* @return true if maven project needs to be re-read from disk
*/
boolean isStale();
ArtifactKey getArtifactKey();
/**
* Associates the value with the key in session (i.e. transient) context.
* Intended as a mechanism to cache state derived from MavenProject.
* Session properties are cleared when MavenProject is re-read from disk.
*
* @see #getSessionProperty(String)
*/
public void setSessionProperty(String key, Object value);
/**
* @return the value associated with the key in session context or null
* if the key is not associated with any value.
*
* @see #setSessionProperty(String, Object)
*/
public Object getSessionProperty(String key);
public Set<ArtifactRepositoryRef> getArtifactRepositoryRefs();
public Set<ArtifactRepositoryRef> getPluginArtifactRepositoryRefs();
public ILifecycleMapping getLifecycleMapping(IProgressMonitor monitor) throws CoreException;
/**
* Returns true if the project configuration is valid. This flag is set by
* {@link ProjectConfigurationManager#validateProjectConfiguration(IMavenProjectFacade, IProgressMonitor)}. Returns
* false if the project configuration has not been validated yet.
*/
boolean hasValidConfiguration();
}
|