You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ah...@apache.org on 2007/11/15 23:22:02 UTC
svn commit: r595476 [3/6] - in /maven/plugins/trunk/maven-eclipse-plugin/src:
main/java/org/apache/maven/plugin/eclipse/
main/java/org/apache/maven/plugin/eclipse/osgiplugin/
main/java/org/apache/maven/plugin/eclipse/writers/
main/java/org/apache/maven...
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadEjbClasspathWriter.java Thu Nov 15 14:21:55 2007
@@ -45,8 +45,8 @@
import org.codehaus.plexus.util.xml.Xpp3DomWriter;
/**
- * Adapts the .classpath file for RAD6 for now write hardcoded:
- * target/websphere/classes future releases could make this varriable.
+ * Adapts the .classpath file for RAD6 for now write hardcoded: target/websphere/classes future releases could make this
+ * varriable.
*
* @author <a href="mailto:nir@cfc.at">Richard van Nieuwenhoven </a>
*/
@@ -76,21 +76,17 @@
private static final String VAR = "var";
- private static final String WEBSPHERE6CONTAIGNER = "com.ibm.wtp.server.java.core.container/com.ibm.ws.ast.st.runtime.core.runtimeTarget.v60/was.base.v6";
+ private static final String WEBSPHERE6CONTAIGNER =
+ "com.ibm.wtp.server.java.core.container/com.ibm.ws.ast.st.runtime.core.runtimeTarget.v60/was.base.v6";
/**
* write the .classpath file to the project root directory.
*
- * @see AbstractWtpResourceWriter#write(EclipseSourceDir[],
- * ArtifactRepository, File)
- * @param sourceDirs
- * all eclipse source directorys
- * @param localRepository
- * the local reposetory
- * @param buildOutputDirectory
- * build output directory (target)
- * @throws MojoExecutionException
- * when writing the config files was not possible
+ * @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)
+ * @param sourceDirs all eclipse source directorys
+ * @param localRepository the local reposetory
+ * @param buildOutputDirectory build output directory (target)
+ * @throws MojoExecutionException when writing the config files was not possible
*/
public void write()
throws MojoExecutionException
@@ -109,8 +105,8 @@
Xpp3Dom[] children = classpath.getChildren();
for ( int index = 0; index < children.length; index++ )
{
- if ( LIB.equals( children[index].getAttribute( KIND ) )
- && TARGET_WEBSPHERE_CLASSES.equals( children[index].getAttribute( "path" ) ) )
+ if ( LIB.equals( children[index].getAttribute( KIND ) ) &&
+ TARGET_WEBSPHERE_CLASSES.equals( children[index].getAttribute( "path" ) ) )
{
return; // nothing to do!
}
@@ -154,11 +150,9 @@
}
/**
- * determinate of witch type this classpath entry is. this is used for
- * sorting them.
+ * determinate of witch type this classpath entry is. this is used for sorting them.
*
- * @param classpathentry
- * the classpath entry to sort
+ * @param classpathentry the classpath entry to sort
* @return an integer identifieing the type
* @see RadEjbClasspathWriter#orderClasspath(Xpp3Dom)
*/
@@ -207,16 +201,11 @@
}
/**
- * Order of classpath this is nessesary for the ejb's the generated classes
- * are elsewise not found.
+ * Order of classpath this is nessesary for the ejb's the generated classes are elsewise not found. 1 - kind=src
+ * ohne starting '/' oder '\' 2 - kind=lib kein ':' und kein start mit '/' oder '\' 3 - kind=src mit ohne starting
+ * '/' oder '\' 4 - kind=var 5 - kind=lib ein ':' oder start mit '/' oder '\' 6 - rest 7 - kind=output
*
- * 1 - kind=src ohne starting '/' oder '\' 2 - kind=lib kein ':' und kein
- * start mit '/' oder '\' 3 - kind=src mit ohne starting '/' oder '\' 4 -
- * kind=var 5 - kind=lib ein ':' oder start mit '/' oder '\' 6 - rest 7 -
- * kind=output
- *
- * @param classpath
- * the classpath to sort
+ * @param classpath the classpath to sort
* @return dom-tree representing ordered classpath
*/
private Xpp3Dom orderClasspath( Xpp3Dom classpath )
@@ -240,8 +229,7 @@
/**
* read an xml file (application.xml or .modulemaps).
*
- * @param xmlFile
- * an xmlfile
+ * @param xmlFile an xmlfile
* @return dom-tree representing the file contents
*/
private Xpp3Dom readXMLFile( File xmlFile )
@@ -265,11 +253,9 @@
}
/**
- * Losche alle pfade die nach was6 zeigen diese sind erkennbar an den
- * parrent runtimes/base_v6/lib.
+ * Losche alle pfade die nach was6 zeigen diese sind erkennbar an den parrent runtimes/base_v6/lib.
*
- * @param classpath
- * classpath to remove was6 libraries
+ * @param classpath classpath to remove was6 libraries
*/
private void removeDupicateWAS6Libs( Xpp3Dom classpath )
{
@@ -281,9 +267,9 @@
{
File path = new File( children[index].getAttribute( PATH ) );
- if ( path.exists() && path.getParentFile().getName().equals( LIB )
- && path.getParentFile().getParentFile().getName().equals( "base_v6" )
- && path.getParentFile().getParentFile().getParentFile().getName().equals( "runtimes" ) )
+ if ( path.exists() && path.getParentFile().getName().equals( LIB ) &&
+ path.getParentFile().getParentFile().getName().equals( "base_v6" ) &&
+ path.getParentFile().getParentFile().getParentFile().getName().equals( "runtimes" ) )
{
Xpp3Dom[] currentChildren = classpath.getChildren();
for ( int deleteIndex = currentChildren.length - 1; deleteIndex >= 0; deleteIndex-- )
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadJ2EEWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadJ2EEWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadJ2EEWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadJ2EEWriter.java Thu Nov 15 14:21:55 2007
@@ -42,7 +42,8 @@
*
* @author <a href="mailto:nir@cfc.at">Richard van Nieuwenhoven</a>
*/
-public class RadJ2EEWriter extends AbstractEclipseWriter
+public class RadJ2EEWriter
+ extends AbstractEclipseWriter
{
private static final String J2EE_FILENAME = ".j2ee";
@@ -57,27 +58,26 @@
* write the .j2ee file to the project root directory.
*
* @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)
- * @param sourceDirs
- * all eclipse source directorys
- * @param localRepository
- * the local reposetory
- * @param buildOutputDirectory
- * build output directory (target)
- * @throws MojoExecutionException
- * when writing the config files was not possible
+ * @param sourceDirs all eclipse source directorys
+ * @param localRepository the local reposetory
+ * @param buildOutputDirectory build output directory (target)
+ * @throws MojoExecutionException when writing the config files was not possible
*/
- public void write() throws MojoExecutionException
+ public void write()
+ throws MojoExecutionException
{
Writer w;
String packaging = config.getPackaging();
- if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging )
- || Constants.PROJECT_PACKAGING_EJB.equalsIgnoreCase( packaging )
- || Constants.PROJECT_PACKAGING_EAR.equalsIgnoreCase( packaging ) )
+ if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( packaging ) ||
+ Constants.PROJECT_PACKAGING_EJB.equalsIgnoreCase( packaging ) ||
+ Constants.PROJECT_PACKAGING_EAR.equalsIgnoreCase( packaging ) )
{
try
{
- w = new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(), J2EE_FILENAME ) ), "UTF-8" );
+ w =
+ new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(),
+ J2EE_FILENAME ) ), "UTF-8" );
}
catch ( IOException ex )
{
@@ -93,10 +93,8 @@
/**
* Writes out the facet info for a faceted-project based on the packaging.
*
- * @param writer
- * where to write to
- * @param packaging
- * packaging type
+ * @param writer where to write to
+ * @param packaging packaging type
*/
private void writeModuleTypeFacetCore( XMLWriter writer, String packaging )
{
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadLibCopier.java Thu Nov 15 14:21:55 2007
@@ -28,13 +28,11 @@
import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter;
import org.apache.maven.plugin.ide.IdeDependency;
import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
/**
- * Copy all dependent jar in the directorys where RAD6 needs then to use the
- * runtime enviorment in RAD6. so all dependent jars in the EAR rootdirectory
- * and all dependend jars in the WAR WEB-INF/lib directory
+ * Copy all dependent jar in the directorys where RAD6 needs then to use the runtime enviorment in RAD6. so all
+ * dependent jars in the EAR rootdirectory and all dependend jars in the WAR WEB-INF/lib directory
*
* @author <a href="mailto:nir@cfc.at">Richard van Nieuwenhoven</a>
*/
@@ -45,8 +43,7 @@
/**
* copy the jars in the apropreate directorys.
*
- * @throws MojoExecutionException
- * when writing the config files was not possible
+ * @throws MojoExecutionException when writing the config files was not possible
*/
public void write()
throws MojoExecutionException
@@ -65,26 +62,21 @@
}
/**
- * Copies the Artifact after building the destination file name if
- * overridden. This method also checks if the classifier is set and adds it
- * to the destination file name if needed.
- *
- * @param deps
- * representing the dependencies to be copied.
- * @param destDir
- * where should the atifact go.
- *
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * Copies the Artifact after building the destination file name if overridden. This method also checks if the
+ * classifier is set and adds it to the destination file name if needed.
*
+ * @param deps representing the dependencies to be copied.
+ * @param destDir where should the atifact go.
+ * @throws MojoExecutionException with a message if an error occurs.
* @see DependencyUtil#copyFile(File, File, Log)
* @see DependencyUtil#getFormattedFileName(Artifact, boolean)
*/
private void copyArtifact( IdeDependency[] deps, File destDir )
throws MojoExecutionException
{
- String[] oldFiles = FileUtils.getFilesFromExtension( destDir.getAbsolutePath(),
- new String[] { Constants.PROJECT_PACKAGING_JAR } );
+ String[] oldFiles =
+ FileUtils.getFilesFromExtension( destDir.getAbsolutePath(),
+ new String[] { Constants.PROJECT_PACKAGING_JAR } );
for ( int index = 0; index < oldFiles.length; index++ )
{
if ( !new File( oldFiles[index] ).delete() )
@@ -94,8 +86,8 @@
}
for ( int index = 0; index < deps.length; index++ )
{
- if ( !deps[index].isTestDependency() && !deps[index].isProvided() && !deps[index].isReferencedProject()
- && !deps[index].isSystemScoped() )
+ if ( !deps[index].isTestDependency() && !deps[index].isProvided() && !deps[index].isReferencedProject() &&
+ !deps[index].isSystemScoped() )
{
copyFile( deps[index].getFile(), new File( destDir, deps[index].getFile().getName() ), log );
}
@@ -105,14 +97,10 @@
/**
* Does the actual copy of the file and logging.
*
- * @param artifact
- * represents the file to copy.
- * @param destFile
- * file name of destination file.
- * @param log
- * to use for output.
- * @throws MojoExecutionException
- * with a message if an error occurs.
+ * @param artifact represents the file to copy.
+ * @param destFile file name of destination file.
+ * @param log to use for output.
+ * @throws MojoExecutionException with a message if an error occurs.
*/
private void copyFile( File artifact, File destFile, Log log )
throws MojoExecutionException
@@ -131,10 +119,8 @@
/**
* EARs need the jars in the root directory.
*
- * @param deps
- * dependencys to include
- * @throws MojoExecutionException
- * if the copying fails
+ * @param deps dependencys to include
+ * @throws MojoExecutionException if the copying fails
*/
private void handleEarLibs( IdeDependency[] deps )
throws MojoExecutionException
@@ -146,19 +132,17 @@
/**
* WARs need the jars in the WEB-INF/lib directory.
*
- * @param deps
- * dependencys to include
- * @throws MojoExecutionException
- * if the copying fails
+ * @param deps dependencys to include
+ * @throws MojoExecutionException if the copying fails
*/
private void handleWarLibs( IdeDependency[] deps )
throws MojoExecutionException
{
File basedir = config.getProject().getBasedir();
- String srcMainWebappWebInfLibDirName = basedir.getAbsolutePath() + File.separatorChar + "src"
- + File.separatorChar + "main" + File.separatorChar + "webapp" + File.separatorChar + "WEB-INF"
- + File.separatorChar + "lib";
+ String srcMainWebappWebInfLibDirName =
+ basedir.getAbsolutePath() + File.separatorChar + "src" + File.separatorChar + "main" + File.separatorChar +
+ "webapp" + File.separatorChar + "WEB-INF" + File.separatorChar + "lib";
File srcMainWebappWebInfLibDir = new File( srcMainWebappWebInfLibDirName );
srcMainWebappWebInfLibDir.mkdirs();
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadManifestWriter.java Thu Nov 15 14:21:55 2007
@@ -41,13 +41,10 @@
import org.apache.maven.project.MavenProject;
/**
- * Create or adapt the manifest files for the RAD6 runtime dependencys.
- * attention these will not be used for the real ear these are just to get the
- * runtime enviorment using the maven dependencies.
- *
- * WARNING: The manifest resources added here will not have the benefit of the dependencies
- * of the project, since that's not provided in the setup() apis, one of the locations from which
- * this writer is used in the RadPlugin.
+ * Create or adapt the manifest files for the RAD6 runtime dependencys. attention these will not be used for the real
+ * ear these are just to get the runtime enviorment using the maven dependencies. WARNING: The manifest resources added
+ * here will not have the benefit of the dependencies of the project, since that's not provided in the setup() apis, one
+ * of the locations from which this writer is used in the RadPlugin.
*
* @author <a href="mailto:nir@cfc.at">Richard van Nieuwenhoven </a>
*/
@@ -59,12 +56,11 @@
private static final String META_INF_DIRECTORY = "META-INF";
- private static final String WEBAPP_RESOURCE_DIR = "src" + File.separatorChar + "main" + File.separatorChar
- + "webapp";
+ private static final String WEBAPP_RESOURCE_DIR =
+ "src" + File.separatorChar + "main" + File.separatorChar + "webapp";
/**
- * Search the project for the existing META-INF directory where the manifest
- * should be located.
+ * Search the project for the existing META-INF directory where the manifest should be located.
*
* @return the apsolute path to the META-INF directory
*/
@@ -74,8 +70,8 @@
if ( config.getProject().equals( Constants.PROJECT_PACKAGING_WAR ) )
{
- metaInfBaseDirectory = config.getProject().getBasedir().getAbsolutePath() + File.separatorChar
- + WEBAPP_RESOURCE_DIR;
+ metaInfBaseDirectory =
+ config.getProject().getBasedir().getAbsolutePath() + File.separatorChar + WEBAPP_RESOURCE_DIR;
log.debug( "Attempting to use: " + metaInfBaseDirectory + " for location of META-INF in war project." );
@@ -108,20 +104,14 @@
}
/**
- * Write the manifest files use an existing one it it exists (it will be
- * overwritten!! in a war use webapp/META-INF else use the generated rad6
- * sourcefolder
+ * Write the manifest files use an existing one it it exists (it will be overwritten!! in a war use webapp/META-INF
+ * else use the generated rad6 sourcefolder
*
- * @see AbstractWtpResourceWriter#write(EclipseSourceDir[],
- * ArtifactRepository, File)
- * @param sourceDirs
- * all eclipse source directorys
- * @param localRepository
- * the local reposetory
- * @param buildOutputDirectory
- * build output directory (target)
- * @throws MojoExecutionException
- * when writing the config files was not possible
+ * @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)
+ * @param sourceDirs all eclipse source directorys
+ * @param localRepository the local reposetory
+ * @param buildOutputDirectory build output directory (target)
+ * @throws MojoExecutionException when writing the config files was not possible
*/
public void write()
throws MojoExecutionException
@@ -137,8 +127,9 @@
Manifest manifest = createNewManifest();
- File manifestFile = new File( metaInfBaseDirectory + File.separatorChar + META_INF_DIRECTORY
- + File.separatorChar + MANIFEST_MF_FILENAME );
+ File manifestFile =
+ new File( metaInfBaseDirectory + File.separatorChar + META_INF_DIRECTORY + File.separatorChar +
+ MANIFEST_MF_FILENAME );
System.out.println( "MANIFEST LOCATION: " + manifestFile );
@@ -161,8 +152,8 @@
}
catch ( Exception e )
{
- log.error( Messages.getString( "EclipsePlugin.cantwritetofile", new Object[] { metaInfBaseDirectory
- + File.separatorChar + MANIFEST_MF_FILENAME } ) );
+ log.error( Messages.getString( "EclipsePlugin.cantwritetofile", new Object[] { metaInfBaseDirectory +
+ File.separatorChar + MANIFEST_MF_FILENAME } ) );
}
}
@@ -190,7 +181,8 @@
if ( !foundMetaInfBaseDirectory )
{
- EclipseSourceDir dir = new EclipseSourceDir( metaInfBaseDirectory, null, true, false, null, null, false );
+ EclipseSourceDir dir =
+ new EclipseSourceDir( metaInfBaseDirectory, null, true, false, null, null, false );
EclipseSourceDir[] newSourceDirs = new EclipseSourceDir[sourceDirs.length + 1];
newSourceDirs[sourceDirs.length] = dir;
@@ -203,14 +195,11 @@
}
/**
- * Add one dependency to the black seperated classpath stringbuffer. Wenn
- * the project is available in the reactor (current build) then the project
- * is used else the jar representing the artifact.
+ * Add one dependency to the black seperated classpath stringbuffer. Wenn the project is available in the reactor
+ * (current build) then the project is used else the jar representing the artifact.
*
- * @param classpath
- * existing classpath to append
- * @param dependency
- * dependency to append as jar or as project
+ * @param classpath existing classpath to append
+ * @param dependency dependency to append as jar or as project
*/
private void addDependencyToClassPath( StringBuffer classpath, IdeDependency dependency )
{
@@ -235,16 +224,12 @@
}
/**
- * Check if the two manifests are equal. Manifest.equal can not be used
- * because of the special case the Classpath entr, witch must be comaired
- * sorted so that a different oder in the classpath does not result in "not
- * equal". This not not realy correct but in this case it is more important
- * to reduce the number of version-controll files.
+ * Check if the two manifests are equal. Manifest.equal can not be used because of the special case the Classpath
+ * entr, witch must be comaired sorted so that a different oder in the classpath does not result in "not equal".
+ * This not not realy correct but in this case it is more important to reduce the number of version-controll files.
*
- * @param manifest
- * the new manifest
- * @param existingManifest
- * to compaire the new one with
+ * @param manifest the new manifest
+ * @param existingManifest to compaire the new one with
* @return are the manifests equal
*/
private boolean areManifestsEqual( Manifest manifest, Manifest existingManifest )
@@ -272,8 +257,8 @@
newValue = orderClasspath( newValue );
existingValue = orderClasspath( existingValue );
}
- if ( ( newValue == null || !newValue.equals( existingValue ) )
- && ( existingValue == null || !existingValue.equals( newValue ) ) )
+ if ( ( newValue == null || !newValue.equals( existingValue ) ) &&
+ ( existingValue == null || !existingValue.equals( newValue ) ) )
{
return false;
}
@@ -282,8 +267,7 @@
}
/**
- * Convert all dependencies in a blank seperated list of jars and projects
- * representing the classpath.
+ * Convert all dependencies in a blank seperated list of jars and projects representing the classpath.
*
* @return the blank separeted classpath string
*/
@@ -314,11 +298,9 @@
}
/**
- * Aphabeticaly sort the classpath. Do this by splitting it up, sort the
- * entries and gleue them together again.
+ * Aphabeticaly sort the classpath. Do this by splitting it up, sort the entries and gleue them together again.
*
- * @param newValue
- * classpath to sort
+ * @param newValue classpath to sort
* @return the sorted classpath
*/
private String orderClasspath( String newValue )
@@ -337,11 +319,9 @@
/**
* Read and parse the existing manifest file.
*
- * @param manifestFile
- * file
+ * @param manifestFile file
* @return the read manifest
- * @throws IOException
- * if the file could not be read
+ * @throws IOException if the file could not be read
*/
private Manifest readExistingManifest( File manifestFile )
throws IOException
@@ -359,16 +339,13 @@
}
/**
- * Verify is the manifest sould be overwritten this sould take in account
- * that the manifest should only be written if the contents of the classpath
- * was changed not the order. The classpath sorting oder should be ignored.
+ * Verify is the manifest sould be overwritten this sould take in account that the manifest should only be written
+ * if the contents of the classpath was changed not the order. The classpath sorting oder should be ignored.
*
- * @param manifest
- * the newly created classpath
- * @param manifestFile
- * the file where the manifest
+ * @param manifest the newly created classpath
+ * @param manifestFile the file where the manifest
* @return if the new manifest file must be written
- * @throws MojoExecutionException
+ * @throws MojoExecutionException
*/
private boolean shouldNewManifestFileBeWritten( Manifest manifest, File manifestFile )
throws MojoExecutionException
@@ -384,8 +361,8 @@
}
catch ( Exception e )
{
- throw new MojoExecutionException( Messages.getString( "EclipseCleanMojo.nofilefound", manifestFile
- .getAbsolutePath() ), e );
+ throw new MojoExecutionException( Messages.getString( "EclipseCleanMojo.nofilefound",
+ manifestFile.getAbsolutePath() ), e );
}
return true;
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebSettingsWriter.java Thu Nov 15 14:21:55 2007
@@ -105,7 +105,9 @@
{
try
{
- w = new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(), WEBSETTINGS_FILENAME ) ), "UTF-8" );
+ w =
+ new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(),
+ WEBSETTINGS_FILENAME ) ), "UTF-8" );
}
catch ( IOException ex )
{
@@ -166,9 +168,9 @@
if ( dependency.isReferencedProject() && !dependency.isTestDependency() && !dependency.isProvided() )
{
- log.debug( "RadWebSettingsWriter: dependency " + dependency.toString()
- + " selected for inclusion as lib-module" );
-
+ log.debug( "RadWebSettingsWriter: dependency " + dependency.toString() +
+ " selected for inclusion as lib-module" );
+
String depName = IdeUtils.getProjectName( config.getProjectNameTemplate(), dependency );
String depJar = dependency.getArtifactId() + ".jar";
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebsiteConfigWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebsiteConfigWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebsiteConfigWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadWebsiteConfigWriter.java Thu Nov 15 14:21:55 2007
@@ -40,7 +40,8 @@
*
* @author <a href="mailto:nir@cfc.at">Richard van Nieuwenhoven</a>
*/
-public class RadWebsiteConfigWriter extends AbstractEclipseWriter
+public class RadWebsiteConfigWriter
+ extends AbstractEclipseWriter
{
private static final String WEBSITE_CONFIG_FILENAME = ".website-config";
@@ -55,23 +56,22 @@
* write the website-config file for RAD6 if needed.
*
* @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)
- * @param sourceDirs
- * all eclipse source directorys
- * @param localRepository
- * the local reposetory
- * @param buildOutputDirectory
- * build output directory (target)
- * @throws MojoExecutionException
- * when writing the config files was not possible
+ * @param sourceDirs all eclipse source directorys
+ * @param localRepository the local reposetory
+ * @param buildOutputDirectory build output directory (target)
+ * @throws MojoExecutionException when writing the config files was not possible
*/
- public void write() throws MojoExecutionException
+ public void write()
+ throws MojoExecutionException
{
Writer w;
if ( Constants.PROJECT_PACKAGING_WAR.equalsIgnoreCase( config.getPackaging() ) )
{
try
{
- w = new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(), WEBSITE_CONFIG_FILENAME ) ), "UTF-8" );
+ w =
+ new OutputStreamWriter( new FileOutputStream( new File( config.getEclipseProjectDirectory(),
+ WEBSITE_CONFIG_FILENAME ) ), "UTF-8" );
}
catch ( IOException ex )
{
@@ -86,8 +86,7 @@
/**
* write the website-config file.
*
- * @param writer
- * wher to write to
+ * @param writer wher to write to
*/
private void writeModuleTypeFacetCore( XMLWriter writer )
{
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseCodeFormatterProfile.java Thu Nov 15 14:21:55 2007
@@ -1,18 +1,14 @@
package org.apache.maven.plugin.eclipse.writers.workspace;
-import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.OutputStream;
import java.io.Reader;
import java.net.URL;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.eclipse.Messages;
-import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
@@ -22,7 +18,6 @@
* an Eclipse code style file
*
* @author dtran
- *
*/
public class EclipseCodeFormatterProfile
@@ -32,13 +27,12 @@
private static final String ELT_PROFILE = "profile";
/**
- * String presentation of the formatter with EOLs are escaped so that it can
- * be embedded in a property value
+ * String presentation of the formatter with EOLs are escaped so that it can be embedded in a property value
*/
private String content;
private String profileName;
-
+
public EclipseCodeFormatterProfile init( URL url, String profileName )
throws MojoExecutionException
{
@@ -49,9 +43,8 @@
{
loadDefaultProfileName( url );
}
-
- this.convertFormatterToString( url );
+ this.convertFormatterToString( url );
return this;
}
@@ -74,11 +67,11 @@
}
catch ( XmlPullParserException e )
{
- throw new MojoExecutionException ( Messages.getString( "EclipsePlugin.cantparseexisting", url.toString() ) ); //$NON-NLS-1$
+ throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantparseexisting", url.toString() ) ); //$NON-NLS-1$
}
catch ( IOException e )
{
- throw new MojoExecutionException ( Messages.getString( "EclipsePlugin.cantparseexisting", url.toString() ) ); //$NON-NLS-1$
+ throw new MojoExecutionException( Messages.getString( "EclipsePlugin.cantparseexisting", url.toString() ) ); //$NON-NLS-1$
}
finally
{
@@ -90,13 +83,13 @@
throws MojoExecutionException
{
InputStream is = null;
-
+
ByteArrayOutputStream os = new ByteArrayOutputStream();
-
+
try
{
is = url.openStream();
-
+
IOUtil.copy( is, os );
}
catch ( IOException e )
@@ -107,9 +100,8 @@
{
IOUtil.close( is );
}
-
+
content = os.toString();
-
}
@@ -117,7 +109,7 @@
{
return this.content;
}
-
+
public String getProfileName()
{
return this.profileName;
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/EclipseWorkspaceWriter.java Thu Nov 15 14:21:55 2007
@@ -18,17 +18,15 @@
{
/**
- * Path under Eclipse workspace where Eclipse Plugin metadata/config is
- * stored.
+ * Path under Eclipse workspace where Eclipse Plugin metadata/config is stored.
*/
public static final String ECLIPSE_PLUGINS_METADATA_DIR = ".metadata/.plugins"; //$NON-NLS-1$
/**
- * Path under {@value #ECLIPSE_PLUGINS_METADATA_DIR } folder where Eclipse
- * Workspace Runtime settings are stored.
+ * Path under {@value #ECLIPSE_PLUGINS_METADATA_DIR } folder where Eclipse Workspace Runtime settings are stored.
*/
- public static final String ECLIPSE_CORE_RUNTIME_SETTINGS_DIR = ECLIPSE_PLUGINS_METADATA_DIR
- + "/org.eclipse.core.runtime/.settings"; //$NON-NLS-1$
+ public static final String ECLIPSE_CORE_RUNTIME_SETTINGS_DIR =
+ ECLIPSE_PLUGINS_METADATA_DIR + "/org.eclipse.core.runtime/.settings"; //$NON-NLS-1$
/**
* File that stores the Eclipse JDT Core preferences.
@@ -80,8 +78,8 @@
Properties props = loadProperties( f );
- EclipseCodeFormatterProfile codeFormatter = new EclipseCodeFormatterProfile()
- .init( config.getCodeStylesURL(), config.getActiveStyleProfileName() );
+ EclipseCodeFormatterProfile codeFormatter =
+ new EclipseCodeFormatterProfile().init( config.getCodeStylesURL(), config.getActiveStyleProfileName() );
if ( codeFormatter.getProfileName() != null )
{
@@ -120,13 +118,13 @@
}
catch ( FileNotFoundException e )
{
- throw new MojoExecutionException( Messages
- .getString( "EclipsePlugin.cantreadfile", f.getAbsolutePath() ), e ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.cantreadfile", f.getAbsolutePath() ), e ); //$NON-NLS-1$
}
catch ( IOException e )
{
- throw new MojoExecutionException( Messages
- .getString( "EclipsePlugin.cantreadfile", f.getAbsolutePath() ), e ); //$NON-NLS-1$
+ throw new MojoExecutionException(
+ Messages.getString( "EclipsePlugin.cantreadfile", f.getAbsolutePath() ), e ); //$NON-NLS-1$
}
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceConfiguration.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceConfiguration.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceConfiguration.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceConfiguration.java Thu Nov 15 14:21:55 2007
@@ -5,22 +5,21 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
-
public class WorkspaceConfiguration
-{
+{
private File workspaceDirectory;
-
- private URL codeStylesURL;
-
+
+ private URL codeStylesURL;
+
private String activeCodeStyleProfileName;
-
+
private ArtifactRepository localRepository;
-
+
public File getWorkspaceDirectory()
{
return this.workspaceDirectory;
}
-
+
public void setWorkspaceDirectory( File dir )
{
this.workspaceDirectory = dir;
@@ -30,22 +29,22 @@
{
return this.codeStylesURL;
}
-
+
public void setCodeStylesURL( URL url )
{
this.codeStylesURL = url;
}
-
+
public String getActiveStyleProfileName()
{
return this.activeCodeStyleProfileName;
}
-
+
public void setActiveStyleProfileName( String name )
{
this.activeCodeStyleProfileName = name;
- }
-
+ }
+
public ArtifactRepository getLocalRepository()
{
return localRepository;
@@ -54,6 +53,6 @@
public void setLocalRepository( ArtifactRepository localRepository )
{
this.localRepository = localRepository;
- }
-
+ }
+
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/workspace/WorkspaceWriter.java Thu Nov 15 14:21:55 2007
@@ -27,6 +27,7 @@
{
/**
* Init this writer.
+ *
* @param log mojo logger.
* @param config writer configuration.
* @return the writer instance
@@ -35,7 +36,9 @@
/**
* Main method that should be implemented by the writer to do the work.
+ *
* @throws MojoExecutionException
*/
- void write() throws MojoExecutionException;
+ void write()
+ throws MojoExecutionException;
}
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java?rev=595476&r1=595475&r2=595476&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/wtp/AbstractWtpResourceWriter.java Thu Nov 15 14:21:55 2007
@@ -18,6 +18,8 @@
*/
package org.apache.maven.plugin.eclipse.writers.wtp;
+import java.io.File;
+
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.eclipse.Messages;
@@ -28,15 +30,14 @@
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.xml.XMLWriter;
-import java.io.File;
-
/**
* Base class to hold common constants used by extending classes.
*
* @author <a href="mailto:rahul.thakur.xdev@gmail.com">Rahul Thakur</a>
* @author <a href="mailto:fgiust@users.sourceforge.net">Fabrizio Giustina</a>
*/
-public abstract class AbstractWtpResourceWriter extends AbstractEclipseWriter
+public abstract class AbstractWtpResourceWriter
+ extends AbstractEclipseWriter
{
private static final String ELT_DEPENDENCY_TYPE = "dependency-type"; //$NON-NLS-1$
@@ -74,7 +75,7 @@
protected static final String ELT_PROJECT_MODULES = "project-modules"; //$NON-NLS-1$
protected static final String ARTIFACT_MAVEN_WAR_PLUGIN = "maven-war-plugin"; //$NON-NLS-1$
-
+
protected static final String ARTIFACT_MAVEN_EAR_PLUGIN = "maven-ear-plugin"; //$NON-NLS-1$
/**
@@ -83,7 +84,8 @@
* @throws MojoExecutionException
*/
protected void writeModuleTypeAccordingToPackaging( MavenProject project, XMLWriter writer,
- File buildOutputDirectory ) throws MojoExecutionException
+ File buildOutputDirectory )
+ throws MojoExecutionException
{
if ( "war".equals( config.getPackaging() ) ) //$NON-NLS-1$
{
@@ -91,7 +93,7 @@
writer.startElement( ELT_VERSION );
- writer.writeText( JeeUtils.resolveServletVersion(project) );
+ writer.writeText( JeeUtils.resolveServletVersion( project ) );
writer.endElement();
String contextRoot = config.getContextName();
@@ -106,15 +108,14 @@
writer.addAttribute( ATTR_MODULE_TYPE_ID, "jst.ejb" ); //$NON-NLS-1$
writer.startElement( ELT_VERSION );
- writer.writeText( JeeUtils.resolveEjbVersion(project) );
+ writer.writeText( JeeUtils.resolveEjbVersion( project ) );
writer.endElement();
writer.startElement( ELT_PROPERTY );
writer.addAttribute( ATTR_NAME, "java-output-path" ); //$NON-NLS-1$
writer.addAttribute( ATTR_VALUE, "/" + //$NON-NLS-1$
- IdeUtils.toRelativeAndFixSeparator( config.getProject().getBasedir(), buildOutputDirectory,
- false ) );
+ IdeUtils.toRelativeAndFixSeparator( config.getProject().getBasedir(), buildOutputDirectory, false ) );
writer.endElement();
}
@@ -123,7 +124,7 @@
writer.addAttribute( ATTR_MODULE_TYPE_ID, "jst.ear" ); //$NON-NLS-1$
writer.startElement( ELT_VERSION );
- writer.writeText( JeeUtils.resolveJeeVersion(project) );
+ writer.writeText( JeeUtils.resolveJeeVersion( project ) );
writer.endElement();
}
else
@@ -134,8 +135,7 @@
writer.startElement( ELT_PROPERTY );
writer.addAttribute( ATTR_NAME, "java-output-path" ); //$NON-NLS-1$
writer.addAttribute( ATTR_VALUE, "/" + //$NON-NLS-1$
- IdeUtils.toRelativeAndFixSeparator( config.getProject().getBasedir(), buildOutputDirectory,
- false ) );
+ IdeUtils.toRelativeAndFixSeparator( config.getProject().getBasedir(), buildOutputDirectory, false ) );
writer.endElement();
}
}
@@ -149,7 +149,8 @@
* @param basedir
* @throws MojoExecutionException
*/
- protected void addDependency( XMLWriter writer, IdeDependency dep, ArtifactRepository localRepository, File basedir, String deployPath )
+ protected void addDependency( XMLWriter writer, IdeDependency dep, ArtifactRepository localRepository,
+ File basedir, String deployPath )
throws MojoExecutionException
{
String handle;
@@ -183,23 +184,23 @@
if ( dep.isSystemScoped() )
{
- handle =
- "module:/classpath/lib/" //$NON-NLS-1$
- + IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(),
- repoFile, false );
+ handle = "module:/classpath/lib/" //$NON-NLS-1$
+ +
+ IdeUtils.toRelativeAndFixSeparator( config.getEclipseProjectDirectory(), repoFile, false );
}
else
{
File localRepositoryFile = new File( localRepository.getBasedir() );
handle = "module:/classpath/var/M2_REPO/" //$NON-NLS-1$
- + IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false );
+ +
+ IdeUtils.toRelativeAndFixSeparator( localRepositoryFile, repoFile, false );
}
}
writer.startElement( ELT_DEPENDENT_MODULE );
- writer.addAttribute( "archiveName",dep.getEclipseProjectName()+"."+dep.getType());
+ writer.addAttribute( "archiveName", dep.getEclipseProjectName() + "." + dep.getType() );
writer.addAttribute( ATTR_DEPLOY_PATH, deployPath ); //$NON-NLS-1$
writer.addAttribute( ATTR_HANDLE, handle );
@@ -214,12 +215,11 @@
protected void writeWarOrEarResources( XMLWriter writer, MavenProject project, ArtifactRepository localRepository )
throws MojoExecutionException
{
- // use /WEB-INF/lib for war projects and / or the configured defaultLibBundleDir for ear projects
- String deployDir = IdeUtils.getPluginSetting( config.getProject(), ARTIFACT_MAVEN_EAR_PLUGIN,
- "defaultLibBundleDir",
- "/" );
-
- if (project.getPackaging().equals("war"))
+ // use /WEB-INF/lib for war projects and / or the configured defaultLibBundleDir for ear projects
+ String deployDir =
+ IdeUtils.getPluginSetting( config.getProject(), ARTIFACT_MAVEN_EAR_PLUGIN, "defaultLibBundleDir", "/" );
+
+ if ( project.getPackaging().equals( "war" ) )
{
deployDir = "/WEB-INF/lib";
}
@@ -230,9 +230,9 @@
String type = dep.getType();
// NB war is needed for ear projects, we suppose nobody adds a war dependency to a war/jar project
- // exclude test and provided and system dependencies outside the project
- if ( ( !dep.isTestDependency() && !dep.isProvided() && !dep.isSystemScopedOutsideProject(project))
- && ( "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) || "war".equals( type ) ) ) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ // exclude test and provided and system dependencies outside the project
+ if ( ( !dep.isTestDependency() && !dep.isProvided() && !dep.isSystemScopedOutsideProject( project ) ) &&
+ ( "jar".equals( type ) || "ejb".equals( type ) || "ejb-client".equals( type ) || "war".equals( type ) ) ) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
{
addDependency( writer, dep, localRepository, config.getProject().getBasedir(), deployDir );
}