Skip to content

Commit 679f521

Browse files
committed
[MECLIPSE-697] Delete deprecated code
Patch of Joseph Walton applied. git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1672304 13f79535-47bb-0310-9956-ffa450edef68
1 parent ec444aa commit 679f521

29 files changed

Lines changed: 53 additions & 1206 deletions

File tree

src/main/java/org/apache/maven/plugin/eclipse/AddMavenRepoMojo.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.apache.maven.plugin.eclipse.writers.EclipseAjdtWriter;
4545
import org.apache.maven.plugin.eclipse.writers.EclipseClasspathWriter;
4646
import org.apache.maven.plugin.eclipse.writers.EclipseManifestWriter;
47-
import org.apache.maven.plugin.eclipse.writers.EclipseOSGiManifestWriter;
4847
import org.apache.maven.plugin.eclipse.writers.EclipseProjectWriter;
4948
import org.apache.maven.plugin.eclipse.writers.EclipseWriterConfig;
5049
import org.apache.maven.plugin.eclipse.writers.workspace.EclipseSettingsWriter;
@@ -129,10 +128,6 @@ public class EclipsePlugin
129128

130129
private static final String BUILDER_WST_FACET = "org.eclipse.wst.common.project.facet.core.builder"; //$NON-NLS-1$
131130

132-
private static final String BUILDER_PDE_MANIFEST = "org.eclipse.pde.ManifestBuilder"; //$NON-NLS-1$
133-
134-
private static final String BUILDER_PDE_SCHEMA = "org.eclipse.pde.SchemaBuilder"; //$NON-NLS-1$
135-
136131
private static final String BUILDER_AJDT_CORE_JAVA = "org.eclipse.ajdt.core.ajbuilder"; //$NON-NLS-1$
137132

138133
private static final String NATURE_WST_MODULE_CORE_NATURE = "org.eclipse.wst.common.modulecore.ModuleCoreNature"; //$NON-NLS-1$
@@ -141,16 +136,12 @@ public class EclipsePlugin
141136

142137
private static final String NATURE_JEM_WORKBENCH_JAVA_EMF = "org.eclipse.jem.workbench.JavaEMFNature"; //$NON-NLS-1$
143138

144-
private static final String NATURE_PDE_PLUGIN = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$
145-
146139
private static final String NATURE_AJDT_CORE_JAVA = "org.eclipse.ajdt.ui.ajnature"; //$NON-NLS-1$
147140

148141
protected static final String COMMON_PATH_JDT_LAUNCHING_JRE_CONTAINER = "org.eclipse.jdt.launching.JRE_CONTAINER"; //$NON-NLS-1$
149142

150143
protected static final String ASPECTJ_RT_CONTAINER = "org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"; //$NON-NLS-1$
151144

152-
protected static final String REQUIRED_PLUGINS_CONTAINER = "org.eclipse.pde.core.requiredPlugins"; //$NON-NLS-1$
153-
154145
// warning, order is important for binary search
155146
public static final String[] WTP_SUPPORTED_VERSIONS = new String[] { "1.0", "1.5", "2.0", "R7", "none" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
156147

@@ -334,16 +325,6 @@ public class EclipsePlugin
334325
*/
335326
private String wtpContextName;
336327

337-
/**
338-
* Is it an PDE project? If yes, the plugin adds the necessary natures and build commands to the .project file.
339-
* Additionally it copies all libraries to a project local directory and references them instead of referencing the
340-
* files in the local Maven repository. It also ensured that the "Bundle-Classpath" in META-INF/MANIFEST.MF is
341-
* synchronized.
342-
*
343-
* @parameter expression="${eclipse.pde}" default-value="false"
344-
*/
345-
private boolean pde;
346-
347328
/**
348329
* Is it an AJDT project? If yes, the plugin adds the necessary natures and build commands to the .project file.
349330
*/
@@ -647,11 +628,6 @@ protected final boolean isJavaProject()
647628
return isJavaProject;
648629
}
649630

650-
protected final boolean isPdeProject()
651-
{
652-
return pde;
653-
}
654-
655631
/**
656632
* Getter for <code>buildcommands</code>.
657633
*
@@ -921,8 +897,7 @@ public final boolean setup()
921897
// ear projects don't contain java sources
922898
// pde projects are always java projects
923899
isJavaProject =
924-
pde
925-
|| ( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
900+
( Constants.LANGUAGE_JAVA.equals( artifactHandler.getLanguage() ) && !Constants.PROJECT_PACKAGING_EAR.equals( packaging ) );
926901

927902
if ( sourceIncludes == null )
928903
{
@@ -1100,7 +1075,8 @@ private boolean validate()
11001075

11011076
if ( "eclipse-plugin".equals( packaging ) )
11021077
{
1103-
pde = true;
1078+
getLog().info( Messages.getString( "EclipsePlugin.pdepackaging" ) ); //$NON-NLS-1$
1079+
return false;
11041080
}
11051081

11061082
if ( eclipseProjectDir == null )
@@ -1215,12 +1191,6 @@ public final void writeConfiguration( IdeDependency[] deps )
12151191
new EclipseWtpApplicationXMLWriter().init( getLog(), config ).write();
12161192
}
12171193

1218-
if ( pde )
1219-
{
1220-
this.getLog().info( "The Maven Eclipse plugin runs in 'pde'-mode." );
1221-
new EclipseOSGiManifestWriter().init( getLog(), config ).write();
1222-
}
1223-
12241194
// NOTE: This one MUST be after EclipseClasspathwriter, and possibly others,
12251195
// since currently EclipseClasspathWriter does some magic to detect nested
12261196
// output folders and modifies the configuration by adding new (Ant) builders.
@@ -1382,7 +1352,6 @@ protected final EclipseWriterConfig createEclipseWriterConfig( IdeDependency[] d
13821352
config.setEclipseProjectDirectory( eclipseProjectDir );
13831353
config.setLocalRepository( localRepository );
13841354
config.setOSGIManifestFile( manifest );
1385-
config.setPde( pde );
13861355
config.setProject( project );
13871356
config.setProjectBaseDir( projectBaseDir );
13881357
config.setProjectnatures( projectnatures );
@@ -1516,11 +1485,6 @@ protected void fillDefaultNatures( String packaging )
15161485
}
15171486
}
15181487

1519-
if ( pde )
1520-
{
1521-
projectnatures.add( NATURE_PDE_PLUGIN );
1522-
}
1523-
15241488
}
15251489

15261490
/**
@@ -1542,10 +1506,6 @@ protected void fillDefaultClasspathContainers( String packaging )
15421506
+ getWorkspaceConfiguration().getDefaultClasspathContainer() );
15431507
classpathContainers.add( getWorkspaceConfiguration().getDefaultClasspathContainer() );
15441508
}
1545-
if ( pde )
1546-
{
1547-
classpathContainers.add( REQUIRED_PLUGINS_CONTAINER );
1548-
}
15491509

15501510
if ( ajdt )
15511511
{
@@ -1597,12 +1557,6 @@ protected void fillDefaultBuilders( String packaging )
15971557
// WTP 0.7 builder
15981558
buildcommands.add( new BuildCommand( BUILDER_WST_COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER ) );
15991559
}
1600-
1601-
if ( pde )
1602-
{
1603-
buildcommands.add( new BuildCommand( BUILDER_PDE_MANIFEST ) );
1604-
buildcommands.add( new BuildCommand( BUILDER_PDE_SCHEMA ) );
1605-
}
16061560
}
16071561

16081562
public final EclipseSourceDir[] buildDirectoryList( MavenProject project, File basedir, File buildOutputDirectory )

src/main/java/org/apache/maven/plugin/eclipse/MakeArtifactsMojo.java

Lines changed: 0 additions & 141 deletions
This file was deleted.

src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,10 @@ private void addDependency( Properties ajdtSettings, IdeDependency dep, String p
148148

149149
String path;
150150

151-
if ( dep.isReferencedProject() && !config.isPde() )
151+
if ( dep.isReferencedProject() )
152152
{
153153
path = "/" + dep.getEclipseProjectName(); //$NON-NLS-1$
154154
}
155-
else if ( dep.isReferencedProject() && config.isPde() )
156-
{
157-
// don't do anything, referenced projects are automatically handled by eclipse in PDE builds
158-
return;
159-
}
160155
else
161156
{
162157
File artifactPath = dep.getFile();
@@ -181,34 +176,18 @@ else if ( dep.isReferencedProject() && config.isPde() )
181176
{
182177
File localRepositoryFile = new File( config.getLocalRepository().getBasedir() );
183178

184-
// if the dependency is not provided and the plugin runs in "pde mode", the dependency is
185-
// added to the Bundle-Classpath:
186-
if ( config.isPde() && ( dep.isProvided() || dep.isOsgiBundle() ) )
187-
{
188-
return;
189-
}
190-
else if ( config.isPde() && !dep.isProvided() && !dep.isTestDependency() )
179+
String fullPath = artifactPath.getPath();
180+
String relativePath =
181+
IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, new File( fullPath ), false );
182+
183+
if ( !new File( relativePath ).isAbsolute() )
191184
{
192-
// path for link created in .project, not to the actual file
193-
path = dep.getFile().getName();
185+
path = EclipseClasspathWriter.M2_REPO + "/" //$NON-NLS-1$
186+
+ relativePath;
194187
}
195-
// running in PDE mode and the dependency is provided means, that it is provided by
196-
// the target platform. This case is covered by adding the plugin container
197188
else
198189
{
199-
String fullPath = artifactPath.getPath();
200-
String relativePath =
201-
IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, new File( fullPath ), false );
202-
203-
if ( !new File( relativePath ).isAbsolute() )
204-
{
205-
path = EclipseClasspathWriter.M2_REPO + "/" //$NON-NLS-1$
206-
+ relativePath;
207-
}
208-
else
209-
{
210-
path = relativePath;
211-
}
190+
path = relativePath;
212191
}
213192
}
214193
}

0 commit comments

Comments
 (0)