Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/reader/ReadWorkspaceLocations.java Fri Sep 25 21:53:36 2015 @@ -1,22 +1,27 @@ +package org.apache.maven.plugin.eclipse.reader; + /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - * or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -package org.apache.maven.plugin.eclipse.reader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.StringReader; @@ -91,10 +96,11 @@ public class ReadWorkspaceLocations public void init( Log log, WorkspaceConfiguration workspaceConfiguration, MavenProject project, String wtpDefaultServer, boolean preferStandardClasspathContainer ) { - workspaceConfiguration.setDefaultClasspathContainer( detectDefaultJREContainer( workspaceConfiguration, - project, - preferStandardClasspathContainer, - log ) ); + workspaceConfiguration.setDefaultClasspathContainer( + detectDefaultJREContainer( workspaceConfiguration, + project, + preferStandardClasspathContainer, + log ) ); readWorkspace( workspaceConfiguration, log ); detectWTPDefaultServer( workspaceConfiguration, wtpDefaultServer, log ); } @@ -106,7 +112,9 @@ public class ReadWorkspaceLocations * @param wtpDefaultServer Default server * @param log the log */ - private void detectWTPDefaultServer( WorkspaceConfiguration workspaceConfiguration, String wtpDefaultServer, Log log ) + private void detectWTPDefaultServer( WorkspaceConfiguration workspaceConfiguration, + String wtpDefaultServer, + Log log ) { Map<String, String> servers = readDefinedServers( workspaceConfiguration, log ); if ( servers == null || servers.isEmpty() ) @@ -150,7 +158,8 @@ public class ReadWorkspaceLocations // now take the default server log.info( "no substring wtp server match." ); workspaceConfiguration.setDefaultDeployServerId( servers.get( "" ) ); - workspaceConfiguration.setDefaultDeployServerName( servers.get( workspaceConfiguration.getDefaultDeployServerId() ) ); + workspaceConfiguration.setDefaultDeployServerName( + servers.get( workspaceConfiguration.getDefaultDeployServerId() ) ); } log.info( "Using as WTP server : " + workspaceConfiguration.getDefaultDeployServerName() ); } @@ -229,7 +238,8 @@ public class ReadWorkspaceLocations } foundContainer = - getContainerFromExecutable( IdeUtils.getCompilerPluginSetting( project, "executable" ), jreMap, logger ); + getContainerFromExecutable( IdeUtils.getCompilerPluginSetting( project, "executable" ), jreMap, + logger ); if ( foundContainer != null ) { return foundContainer; @@ -350,7 +360,6 @@ public class ReadWorkspaceLocations * @param projectLocation the location of the project * @param logger the logger to report errors and debug info. * @return an {@link IdeDependency} or null. - * @throws FileNotFoundException * @throws XmlPullParserException * @throws IOException */ @@ -405,8 +414,8 @@ public class ReadWorkspaceLocations { Properties properties = new Properties(); properties.load( new FileInputStream( prefs ) ); - String runtimes = - properties.getProperty( ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_RUNTIMES_KEY ); + String runtimes = properties.getProperty( + ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_RUNTIMES_KEY ); if ( runtimes != null ) { runtimesElement = Xpp3DomBuilder.build( new StringReader( runtimes ) ); @@ -479,8 +488,8 @@ public class ReadWorkspaceLocations Properties properties = new Properties(); properties.load( new FileInputStream( prefs ) ); vms = - Xpp3DomBuilder.build( new StringReader( - properties.getProperty( ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_VM_KEY ) ) ); + Xpp3DomBuilder.build( new StringReader( properties.getProperty( + ReadWorkspaceLocations.METADATA_PLUGINS_ORG_ECLIPSE_CORE_RUNTIME_PREFS_VM_KEY ) ) ); } catch ( Exception e ) { @@ -577,7 +586,7 @@ public class ReadWorkspaceLocations return projectLocations; } - + /** * Scan the eclipse workspace and create a array with {@link IdeDependency} for all found artifacts. *
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseManifestWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseManifestWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseManifestWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseManifestWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.io.FileInputStream; @@ -28,11 +29,8 @@ import java.util.Set; import java.util.jar.Attributes; import java.util.jar.Manifest; -import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.eclipse.EclipseSourceDir; import org.apache.maven.plugin.eclipse.Messages; -import org.apache.maven.plugin.eclipse.writers.wtp.AbstractWtpResourceWriter; import org.apache.maven.plugin.ide.IdeDependency; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.IOUtil; @@ -70,9 +68,10 @@ public abstract class AbstractEclipseMan String[] entries = newValue.split( " " ); Arrays.sort( entries ); StringBuilder buffer = new StringBuilder( newValue.length() ); - for (String entry : entries) { - buffer.append(entry); - buffer.append(' '); + for ( String entry : entries ) + { + buffer.append( entry ); + buffer.append( ' ' ); } return buffer.toString(); } @@ -159,20 +158,23 @@ public abstract class AbstractEclipseMan Attributes newMap = manifest.getMainAttributes(); keys.addAll( existingMap.keySet() ); keys.addAll( newMap.keySet() ); - for (Object key1 : keys) { + for ( Object key1 : keys ) + { Attributes.Name key = (Attributes.Name) key1; - String newValue = (String) newMap.get(key); - String existingValue = (String) existingMap.get(key); + String newValue = (String) newMap.get( key ); + String existingValue = (String) existingMap.get( key ); // special case classpath... they are equal when there entries // are equal - if (Attributes.Name.CLASS_PATH.equals(key)) { - newValue = orderClasspath(newValue); - existingValue = orderClasspath(existingValue); + if ( Attributes.Name.CLASS_PATH.equals( key ) ) + { + newValue = orderClasspath( newValue ); + existingValue = orderClasspath( existingValue ); } - if ((newValue == null || !newValue.equals(existingValue)) - && (existingValue == null || !existingValue.equals(newValue))) { - log.info("@@@ FALSE - Manifest are not equal because key = " + key + " has existing value = " - + existingValue + " and new value = " + newValue + " are different"); + if ( ( newValue == null || !newValue.equals( existingValue ) ) + && ( existingValue == null || !existingValue.equals( newValue ) ) ) + { + log.info( "@@@ FALSE - Manifest are not equal because key = " + key + " has existing value = " + + existingValue + " and new value = " + newValue + " are different" ); return false; } } @@ -187,14 +189,15 @@ public abstract class AbstractEclipseMan */ protected String constructManifestClasspath() { - StringBuilder StringBuilder = new StringBuilder(); + StringBuilder stringBuilder = new StringBuilder(); IdeDependency[] deps = this.config.getDeps(); - for (IdeDependency dep : deps) { - addDependencyToClassPath(StringBuilder, dep); + for ( IdeDependency dep : deps ) + { + addDependencyToClassPath( stringBuilder, dep ); } - return StringBuilder.toString(); + return stringBuilder.toString(); } /** @@ -227,7 +230,7 @@ public abstract class AbstractEclipseMan Manifest existingManifest = readExistingManifest( manifestFile ); if ( areManifestsEqual( manifest, existingManifest ) ) { - this.log.info( Messages.getString( "EclipsePlugin.unchangedmanifest", manifestFile.getAbsolutePath() ) ); + log.info( Messages.getString( "EclipsePlugin.unchangedmanifest", manifestFile.getAbsolutePath() ) ); return false; } } @@ -255,7 +258,6 @@ public abstract class AbstractEclipseMan * Otherwise generate a <b>NEW</b> (i.e the old one is overwritten) which only contains values for MANIFEST_VERSION * and CLASS_PATH, all other previous entries are not kept. * - * @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File) * @param sourceDirs all eclipse source directorys * @param localRepository the local reposetory * @param buildOutputDirectory build output directory (target) @@ -270,9 +272,8 @@ public abstract class AbstractEclipseMan { // TODO: if this really is an error, shouldn't we stop the build?? throw new MojoExecutionException( - Messages.getString( - "EclipseCleanMojo.nofilefound", - new Object[] { EclipseManifestWriter.META_INF_DIRECTORY } ) ); + Messages.getString( "EclipseCleanMojo.nofilefound", + new Object[] { EclipseManifestWriter.META_INF_DIRECTORY } ) ); } File manifestFile = new File( metaInfBaseDirectory + File.separatorChar + EclipseManifestWriter.META_INF_DIRECTORY Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/AbstractEclipseWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import org.apache.maven.plugin.logging.Log; Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAjdtWriter.java Fri Sep 25 21:53:36 2015 @@ -1,19 +1,22 @@ package org.apache.maven.plugin.eclipse.writers; /* - * Copyright 2001-2005 The Apache Software Foundation. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ import java.io.File; @@ -83,20 +86,23 @@ public class EclipseAjdtWriter IdeDependency[] deps = config.getDeps(); int ajdtDepCount = 0; int ajdtWeaveDepCount = 0; - for (IdeDependency dep : deps) { - if (dep.isAjdtDependency()) { - addDependency(ajdtSettings, dep, ASPECT_DEP_PROP, ++ajdtDepCount); + for ( IdeDependency dep : deps ) + { + if ( dep.isAjdtDependency() ) + { + addDependency( ajdtSettings, dep, ASPECT_DEP_PROP, ++ajdtDepCount ); } - if (dep.isAjdtWeaveDependency()) { - addDependency(ajdtSettings, dep, WEAVE_DEP_PROP, ++ajdtWeaveDepCount); + if ( dep.isAjdtWeaveDependency() ) + { + addDependency( ajdtSettings, dep, WEAVE_DEP_PROP, ++ajdtWeaveDepCount ); } } // write the settings, if needed if ( !ajdtSettings.isEmpty() ) { - File settingsDir = new File( config.getEclipseProjectDirectory(), DIR_DOT_SETTINGS ); //$NON-NLS-1$ + File settingsDir = new File( config.getEclipseProjectDirectory(), DIR_DOT_SETTINGS ); settingsDir.mkdirs(); @@ -127,17 +133,19 @@ public class EclipseAjdtWriter { ajdtSettings.store( new FileOutputStream( ajdtSettingsFile ), null ); - log.info( Messages.getString( "EclipseSettingsWriter.wrotesettings", //$NON-NLS-1$ + log.info( Messages.getString( "EclipseSettingsWriter.wrotesettings", ajdtSettingsFile.getCanonicalPath() ) ); } } catch ( FileNotFoundException e ) { - throw new MojoExecutionException( Messages.getString( "EclipseSettingsWriter.cannotcreatesettings" ), e ); //$NON-NLS-1$ + throw new MojoExecutionException( + Messages.getString( "EclipseSettingsWriter.cannotcreatesettings" ), e ); } catch ( IOException e ) { - throw new MojoExecutionException( Messages.getString( "EclipseSettingsWriter.errorwritingsettings" ), e ); //$NON-NLS-1$ + throw new MojoExecutionException( + Messages.getString( "EclipseSettingsWriter.errorwritingsettings" ), e ); } } } @@ -158,7 +166,7 @@ public class EclipseAjdtWriter if ( artifactPath == null ) { - log.error( Messages.getString( "EclipsePlugin.artifactpathisnull", dep.getId() ) ); //$NON-NLS-1$ + log.error( Messages.getString( "EclipsePlugin.artifactpathisnull", dep.getId() ) ); return; } @@ -168,7 +176,7 @@ public class EclipseAjdtWriter if ( log.isDebugEnabled() ) { - log.debug( Messages.getString( "EclipsePlugin.artifactissystemscoped", //$NON-NLS-1$ + log.debug( Messages.getString( "EclipsePlugin.artifactissystemscoped", new Object[] { dep.getArtifactId(), path } ) ); } } @@ -182,7 +190,7 @@ public class EclipseAjdtWriter if ( !new File( relativePath ).isAbsolute() ) { - path = EclipseClasspathWriter.M2_REPO + "/" //$NON-NLS-1$ + path = EclipseClasspathWriter.M2_REPO + "/" + relativePath; } else Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAntExternalLaunchConfigurationWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAntExternalLaunchConfigurationWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAntExternalLaunchConfigurationWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseAntExternalLaunchConfigurationWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.util.List; @@ -60,8 +61,8 @@ public class EclipseAntExternalLaunchCon writeAttribute( writer, "org.eclipse.debug.core.MAPPED_RESOURCE_TYPES", new String[] { "1" } ); - writeAttribute( writer, "org.eclipse.debug.core.MAPPED_RESOURCE_PATHS", new String[] { "/" - + config.getEclipseProjectName() + "/" + buildfilePath } ); + writeAttribute( writer, "org.eclipse.debug.core.MAPPED_RESOURCE_PATHS", + new String[] { "/" + config.getEclipseProjectName() + "/" + buildfilePath } ); } protected String getLaunchConfigurationType() Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseClasspathWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.io.FileOutputStream; @@ -168,7 +169,7 @@ public class EclipseClasspathWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); @@ -182,23 +183,19 @@ public class EclipseClasspathWriter // Source roots and resources // ---------------------------------------------------------------------- - // List<EclipseSourceDir> - List specialSources = new ArrayList(); + List<EclipseSourceDir> specialSources = new ArrayList<EclipseSourceDir>(); - // Map<String,List<EclipseSourceDir>> - Map byOutputDir = new HashMap(); + Map<String, List<EclipseSourceDir>> byOutputDir = new HashMap<String, List<EclipseSourceDir>>(); for ( int j = 0; j < config.getSourceDirs().length; j++ ) { EclipseSourceDir dir = config.getSourceDirs()[j]; - // List<EclipseSourceDir> - List byOutputDirs = (List) byOutputDir.get( dir.getOutput() ); + List<EclipseSourceDir> byOutputDirs = byOutputDir.get( dir.getOutput() ); if ( byOutputDirs == null ) { - // ArrayList<EclipseSourceDir> - byOutputDir.put( dir.getOutput() == null ? defaultOutput : dir.getOutput(), byOutputDirs = - new ArrayList() ); + byOutputDirs = new ArrayList<EclipseSourceDir>(); + byOutputDir.put( dir.getOutput() == null ? defaultOutput : dir.getOutput(), byOutputDirs ); } byOutputDirs.add( dir ); } @@ -285,21 +282,24 @@ public class EclipseClasspathWriter buildXmlPrinter.addAttribute( NAME, "copy-resources" ); buildXmlPrinter.addAttribute( "depends", "init" ); - for (Object specialSource : specialSources) { + for ( Object specialSource : specialSources ) + { // TODO: merge source dirs on output path+filtering to reduce // <copy> tags for speed. EclipseSourceDir dir = (EclipseSourceDir) specialSource; - buildXmlPrinter.startElement("copy"); - buildXmlPrinter.addAttribute("todir", dir.getOutput()); - buildXmlPrinter.addAttribute("filtering", "" + dir.isFiltering()); - - buildXmlPrinter.startElement("fileset"); - buildXmlPrinter.addAttribute("dir", dir.getPath()); - if (dir.getIncludeAsString() != null) { - buildXmlPrinter.addAttribute("includes", dir.getIncludeAsString()); + buildXmlPrinter.startElement( "copy" ); + buildXmlPrinter.addAttribute( "todir", dir.getOutput() ); + buildXmlPrinter.addAttribute( "filtering", "" + dir.isFiltering() ); + + buildXmlPrinter.startElement( "fileset" ); + buildXmlPrinter.addAttribute( "dir", dir.getPath() ); + if ( dir.getIncludeAsString() != null ) + { + buildXmlPrinter.addAttribute( "includes", dir.getIncludeAsString() ); } - if (dir.getExcludeAsString() != null) { - buildXmlPrinter.addAttribute("excludes", dir.getExcludeAsString()); + if ( dir.getExcludeAsString() != null ) + { + buildXmlPrinter.addAttribute( "excludes", dir.getExcludeAsString() ); } buildXmlPrinter.endElement(); @@ -325,13 +325,12 @@ public class EclipseClasspathWriter // finally add it to the project writer. - config.getBuildCommands().add( - new BuildCommand( - "org.eclipse.ui.externaltools.ExternalToolBuilder", - "LaunchConfigHandle", - "<project>/" - + EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS - + "Maven_Ant_Builder.launch" ) ); + config.getBuildCommands().add( new BuildCommand( + "org.eclipse.ui.externaltools.ExternalToolBuilder", + "LaunchConfigHandle", + "<project>/" + + EclipseLaunchConfigurationWriter.FILE_DOT_EXTERNAL_TOOL_BUILDERS + + "Maven_Ant_Builder.launch" ) ); } // ---------------------------------------------------------------------- @@ -344,47 +343,52 @@ public class EclipseClasspathWriter writer.endElement(); Set addedDependencies = new HashSet(); - + // ---------------------------------------------------------------------- // Java API dependencies that may complete the classpath container must // be declared BEFORE all other dependencies so that container access rules don't fail // ---------------------------------------------------------------------- IdeDependency[] depsToWrite = config.getDeps(); - for (IdeDependency dep : depsToWrite) { - if (dep.isJavaApi()) { - String depId = getDependencyId(dep); - if (!addedDependencies.contains(depId)) { - addDependency(writer, dep); - addedDependencies.add(depId); + for ( IdeDependency dep : depsToWrite ) + { + if ( dep.isJavaApi() ) + { + String depId = getDependencyId( dep ); + if ( !addedDependencies.contains( depId ) ) + { + addDependency( writer, dep ); + addedDependencies.add( depId ); } } } - - if (!config.isClasspathContainersLast()) + if ( !config.isClasspathContainersLast() ) { - writeClasspathContainers(writer); + writeClasspathContainers( writer ); } // ---------------------------------------------------------------------- // The project's dependencies // ---------------------------------------------------------------------- - for (IdeDependency dep : depsToWrite) { - if (dep.isAddedToClasspath()) { - String depId = getDependencyId(dep); + for ( IdeDependency dep : depsToWrite ) + { + if ( dep.isAddedToClasspath() ) + { + String depId = getDependencyId( dep ); /* avoid duplicates in the classpath for artifacts with different types (like ejbs or test-jars) */ - if (!addedDependencies.contains(depId)) { - addDependency(writer, dep); - addedDependencies.add(depId); + if ( !addedDependencies.contains( depId ) ) + { + addDependency( writer, dep ); + addedDependencies.add( depId ); } } } - if (config.isClasspathContainersLast()) + if ( config.isClasspathContainersLast() ) { - writeClasspathContainers(writer); + writeClasspathContainers( writer ); } - + writer.endElement(); IOUtil.close( w ); @@ -394,16 +398,17 @@ public class EclipseClasspathWriter /** * @param writer */ - private void writeClasspathContainers(XMLWriter writer) + private void writeClasspathContainers( XMLWriter writer ) { // ---------------------------------------------------------------------- // Container classpath entries // ---------------------------------------------------------------------- - for (Object o : config.getClasspathContainers()) { - writer.startElement(ELT_CLASSPATHENTRY); - writer.addAttribute(ATTR_KIND, "con"); //$NON-NLS-1$ - writer.addAttribute(ATTR_PATH, (String) o); + for ( Object o : config.getClasspathContainers() ) + { + writer.startElement( ELT_CLASSPATHENTRY ); + writer.addAttribute( ATTR_KIND, "con" ); //$NON-NLS-1$ + writer.addAttribute( ATTR_PATH, (String) o ); writer.endElement(); // name } } @@ -508,7 +513,7 @@ public class EclipseClasspathWriter // Replace aspectJ runtime library with ajdt ASPECTJRT_CONTAINER. if ( ( config.getAjdtVersion() != 0 ) && isAspectJRuntime( dep ) ) { - if ( ! config.getClasspathContainers().contains( ASPECTJRT_CONTAINER ) ) + if ( !config.getClasspathContainers().contains( ASPECTJRT_CONTAINER ) ) { config.getClasspathContainers().add( ASPECTJRT_CONTAINER ); } @@ -530,13 +535,13 @@ public class EclipseClasspathWriter { if ( !attributeElemOpen ) { - writer.startElement( ATTRIBUTES ); //$NON-NLS-1$ + writer.startElement( ATTRIBUTES ); attributeElemOpen = true; } - writer.startElement( ATTRIBUTE ); //$NON-NLS-1$ - writer.addAttribute( VALUE, "jar:" + new File( javadocpath ).toURI() + "!/" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - writer.addAttribute( NAME, "javadoc_location" ); //$NON-NLS-1$ //$NON-NLS-2$ + writer.startElement( ATTRIBUTE ); + writer.addAttribute( VALUE, "jar:" + new File( javadocpath ).toURI() + "!/" ); + writer.addAttribute( NAME, "javadoc_location" ); writer.endElement(); } @@ -547,46 +552,48 @@ public class EclipseClasspathWriter { if ( !attributeElemOpen ) { - writer.startElement( ATTRIBUTES ); //$NON-NLS-1$ + writer.startElement( ATTRIBUTES ); attributeElemOpen = true; } - writer.startElement( ATTRIBUTE ); //$NON-NLS-1$ - writer.addAttribute( VALUE, "/WEB-INF/lib" ); //$NON-NLS-1$ //$NON-NLS-2$ - writer.addAttribute( NAME, "org.eclipse.jst.component.dependency" ); //$NON-NLS-1$ //$NON-NLS-2$ + writer.startElement( ATTRIBUTE ); + writer.addAttribute( VALUE, "/WEB-INF/lib" ); + writer.addAttribute( NAME, "org.eclipse.jst.component.dependency" ); writer.endElement(); } + // CHECKSTYLE_OFF: MagicNumber if ( dep.isAjdtDependency() && ( config.getAjdtVersion() >= 1.5 ) ) { if ( !attributeElemOpen ) { - writer.startElement( ATTRIBUTES ); //$NON-NLS-1$ + writer.startElement( ATTRIBUTES ); attributeElemOpen = true; } - writer.startElement( ATTRIBUTE ); //$NON-NLS-1$ - writer.addAttribute( NAME, ORG_ECLIPSE_AJDT_ASPECTPATH ); //$NON-NLS-1$ //$NON-NLS-2$ - writer.addAttribute( VALUE, Boolean.TRUE.toString() ); //$NON-NLS-1$ //$NON-NLS-2$ + writer.startElement( ATTRIBUTE ); + writer.addAttribute( NAME, ORG_ECLIPSE_AJDT_ASPECTPATH ); + writer.addAttribute( VALUE, Boolean.TRUE.toString() ); writer.endElement(); - } + // CHECKSTYLE_ON: MagicNumber + // CHECKSTYLE_OFF: MagicNumber if ( dep.isAjdtWeaveDependency() && ( config.getAjdtVersion() >= 1.5 ) ) { if ( !attributeElemOpen ) { - writer.startElement( ATTRIBUTES ); //$NON-NLS-1$ + writer.startElement( ATTRIBUTES ); attributeElemOpen = true; } - writer.startElement( ATTRIBUTE ); //$NON-NLS-1$ - writer.addAttribute( NAME, ORG_ECLIPSE_AJDT_INPATH ); //$NON-NLS-1$ //$NON-NLS-2$ - writer.addAttribute( VALUE, Boolean.TRUE.toString() ); //$NON-NLS-1$ //$NON-NLS-2$ + writer.startElement( ATTRIBUTE ); + writer.addAttribute( NAME, ORG_ECLIPSE_AJDT_INPATH ); + writer.addAttribute( VALUE, Boolean.TRUE.toString() ); writer.endElement(); - } + // CHECKSTYLE_ON: MagicNumber if ( attributeElemOpen ) { Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseLaunchConfigurationWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseLaunchConfigurationWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseLaunchConfigurationWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseLaunchConfigurationWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.io.FileOutputStream; @@ -81,7 +82,7 @@ public abstract class EclipseLaunchConfi } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); @@ -123,7 +124,8 @@ public abstract class EclipseLaunchConfi + " factoryID='org.eclipse.ui.internal.WorkingSetFactory'" + " label='workingSet'" + " name='workingSet'>"; - for (Object o : getMonitoredResources()) { + for ( Object o : getMonitoredResources() ) + { MonitoredResource monitoredResource = (MonitoredResource) o; workingSet += monitoredResource.print(); @@ -206,9 +208,10 @@ public abstract class EclipseLaunchConfi writer.startElement( "listAttribute" ); writer.addAttribute( "key", key ); - for (String value : values) { - writer.startElement("listEntry"); - writer.addAttribute("value", value); + for ( String value : values ) + { + writer.startElement( "listEntry" ); + writer.addAttribute( "value", value ); writer.endElement(); } Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseManifestWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseManifestWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseManifestWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseManifestWriter.java Fri Sep 25 21:53:36 2015 @@ -1,17 +1,23 @@ +package org.apache.maven.plugin.eclipse.writers; + /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - * or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language - * governing permissions and limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.io.IOException; @@ -37,11 +43,11 @@ public class EclipseManifestWriter extends AbstractEclipseManifestWriter { - private static final String GENERATED_RESOURCE_DIRNAME = - "target" + File.separatorChar + "generated-resources" + File.separatorChar + "eclipse"; + private static final String GENERATED_RESOURCE_DIRNAME = "target" + File.separatorChar + "generated-resources" + + File.separatorChar + "eclipse"; - 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"; /** * Returns absolute path to the web content directory based on configuration of the war plugin or default one @@ -85,10 +91,10 @@ public class EclipseManifestWriter // getting the path to meta-inf base dir metaInfBaseDirectory = getWebContentBaseDirectory( this.config ); - this.log.debug( "Attempting to use: " + metaInfBaseDirectory + " for location of META-INF in war project." ); + log.debug( "Attempting to use: " + metaInfBaseDirectory + " for location of META-INF in war project." ); - File metaInfDirectoryFile = - new File( metaInfBaseDirectory + File.separatorChar + AbstractEclipseManifestWriter.META_INF_DIRECTORY ); + File metaInfDirectoryFile = new File( metaInfBaseDirectory + File.separatorChar + + AbstractEclipseManifestWriter.META_INF_DIRECTORY ); if ( !metaInfDirectoryFile.exists() || ( metaInfDirectoryFile.exists() && !metaInfDirectoryFile.isDirectory() ) ) Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseProjectWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.io.FileInputStream; @@ -118,9 +119,10 @@ public class EclipseProjectWriter if ( naturesElement != null ) { Xpp3Dom[] existingNatures = naturesElement.getChildren( ELT_NATURE ); - for (Xpp3Dom existingNature : existingNatures) { + for ( Xpp3Dom existingNature : existingNatures ) + { // adds all the existing natures - projectnatures.add(existingNature.getValue()); + projectnatures.add( existingNature.getValue() ); } } @@ -128,10 +130,12 @@ public class EclipseProjectWriter if ( buildSpec != null ) { Xpp3Dom[] existingBuildCommands = buildSpec.getChildren( ELT_BUILD_COMMAND ); - for (Xpp3Dom existingBuildCommand : existingBuildCommands) { - Xpp3Dom buildCommandName = existingBuildCommand.getChild(ELT_NAME); - if (buildCommandName != null) { - buildCommands.add(new BuildCommand(existingBuildCommand)); + for ( Xpp3Dom existingBuildCommand : existingBuildCommands ) + { + Xpp3Dom buildCommandName = existingBuildCommand.getChild( ELT_NAME ); + if ( buildCommandName != null ) + { + buildCommands.add( new BuildCommand( existingBuildCommand ) ); } } } @@ -140,12 +144,14 @@ public class EclipseProjectWriter if ( linkedResourcesElement != null ) { Xpp3Dom[] existingLinks = linkedResourcesElement.getChildren( ELT_LINK ); - for (Xpp3Dom existingLink : existingLinks) { - Xpp3Dom linkName = existingLink.getChild(ELT_NAME); - if (linkName != null) { + for ( Xpp3Dom existingLink : existingLinks ) + { + Xpp3Dom linkName = existingLink.getChild( ELT_NAME ); + if ( linkName != null ) + { // add all the existing symbolic links - linkNames.add(existingLink.getChild(ELT_NAME).getValue()); - linkedResources.add(new LinkedResource(existingLink)); + linkNames.add( existingLink.getChild( ELT_NAME ).getValue() ); + linkedResources.add( new LinkedResource( existingLink ) ); } } } @@ -153,11 +159,11 @@ public class EclipseProjectWriter } catch ( XmlPullParserException e ) { - log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); //$NON-NLS-1$ + log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); } catch ( IOException e ) { - log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); //$NON-NLS-1$ + log.warn( Messages.getString( "EclipsePlugin.cantparseexisting", dotProject.getAbsolutePath() ) ); } finally { @@ -166,16 +172,19 @@ public class EclipseProjectWriter } // adds new entries after the existing ones - for (Object o2 : config.getProjectnatures()) { - projectnatures.add(o2); + for ( Object o2 : config.getProjectnatures() ) + { + projectnatures.add( o2 ); } - for (Object o1 : config.getBuildCommands()) { - buildCommands.add(o1); + for ( Object o1 : config.getBuildCommands() ) + { + buildCommands.add( o1 ); } - for (Object o : config.getLinkedResources()) { - linkedResources.add(o); + for ( Object o : config.getLinkedResources() ) + { + linkedResources.add( o ); } Writer w; @@ -186,7 +195,7 @@ public class EclipseProjectWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); @@ -204,14 +213,16 @@ public class EclipseProjectWriter IdeDependency[] dependencies = config.getDeps(); List duplicates = new ArrayList(); - for (IdeDependency dep : dependencies) { + for ( IdeDependency dep : dependencies ) + { // Avoid duplicates entries when same project is refered using multiple types // (ejb, test-jar ...) - if (dep.isReferencedProject() && !duplicates.contains(dep.getEclipseProjectName())) { - writer.startElement("project"); //$NON-NLS-1$ - writer.writeText(dep.getEclipseProjectName()); + if ( dep.isReferencedProject() && !duplicates.contains( dep.getEclipseProjectName() ) ) + { + writer.startElement( "project" ); //$NON-NLS-1$ + writer.writeText( dep.getEclipseProjectName() ); writer.endElement(); - duplicates.add(dep.getEclipseProjectName()); + duplicates.add( dep.getEclipseProjectName() ); } } @@ -219,17 +230,19 @@ public class EclipseProjectWriter writer.startElement( ELT_BUILD_SPEC ); - for (Object buildCommand : buildCommands) { - ((BuildCommand) buildCommand).print(writer); + for ( Object buildCommand : buildCommands ) + { + ( (BuildCommand) buildCommand ).print( writer ); } writer.endElement(); // buildSpec writer.startElement( ELT_NATURES ); - for (Object projectnature : projectnatures) { - writer.startElement(ELT_NATURE); - writer.writeText((String) projectnature); + for ( Object projectnature : projectnatures ) + { + writer.startElement( ELT_NATURE ); + writer.writeText( (String) projectnature ); writer.endElement(); // name } @@ -243,8 +256,9 @@ public class EclipseProjectWriter // preserve the symbolic links if ( linkedResources.size() > 0 ) { - for (Object linkedResource : linkedResources) { - ((LinkedResource) linkedResource).print(writer); + for ( Object linkedResource : linkedResources ) + { + ( (LinkedResource) linkedResource ).print( writer ); } } @@ -293,15 +307,17 @@ public class EclipseProjectWriter private void addSourceLinks( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots ) throws MojoExecutionException { - for (Object sourceRoot1 : sourceRoots) { + for ( Object sourceRoot1 : sourceRoots ) + { String sourceRootString = (String) sourceRoot1; - File sourceRoot = new File(sourceRootString); + File sourceRoot = new File( sourceRootString ); - if (sourceRoot.isDirectory()) { - String name = IdeUtils.toRelativeAndFixSeparator(projectBaseDir, sourceRoot, true); - String location = IdeUtils.fixSeparator(IdeUtils.getCanonicalPath(sourceRoot)); + if ( sourceRoot.isDirectory() ) + { + String name = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, sourceRoot, true ); + String location = IdeUtils.fixSeparator( IdeUtils.getCanonicalPath( sourceRoot ) ); - addLink(writer, name, location, LINK_TYPE_DIRECTORY); + addLink( writer, name, location, LINK_TYPE_DIRECTORY ); } } } @@ -309,15 +325,17 @@ public class EclipseProjectWriter private void addResourceLinks( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots ) throws MojoExecutionException { - for (Object sourceRoot : sourceRoots) { - String resourceDirString = ((Resource) sourceRoot).getDirectory(); - File resourceDir = new File(resourceDirString); - - if (resourceDir.isDirectory()) { - String name = IdeUtils.toRelativeAndFixSeparator(projectBaseDir, resourceDir, true); - String location = IdeUtils.fixSeparator(IdeUtils.getCanonicalPath(resourceDir)); + for ( Object sourceRoot : sourceRoots ) + { + String resourceDirString = ( (Resource) sourceRoot ).getDirectory(); + File resourceDir = new File( resourceDirString ); + + if ( resourceDir.isDirectory() ) + { + String name = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, resourceDir, true ); + String location = IdeUtils.fixSeparator( IdeUtils.getCanonicalPath( resourceDir ) ); - addLink(writer, name, location, LINK_TYPE_DIRECTORY); + addLink( writer, name, location, LINK_TYPE_DIRECTORY ); } } } @@ -374,7 +392,8 @@ public class EclipseProjectWriter // // Project files that are generated with m-p-e cannot be supported by M2Eclipse // - comment += "NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse."; + comment += + "NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse."; writer.startElement( ELT_COMMENT ); writer.writeText( comment ); Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriterConfig.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriterConfig.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriterConfig.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseWriterConfig.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,14 +18,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; import java.io.File; import java.util.List; import java.util.Map; import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.plugin.eclipse.EclipsePlugin; import org.apache.maven.plugin.eclipse.EclipseSourceDir; import org.apache.maven.plugin.eclipse.WorkspaceConfiguration; import org.apache.maven.plugin.ide.IdeDependency; @@ -106,23 +106,23 @@ public class EclipseWriterConfig private List classpathContainers; /** - * @see EclipsePlugin#getProjectNameTemplate() + * @see org.apache.maven.plugin.eclipse.EclipsePlugin#getProjectNameTemplate() */ private String projectNameTemplate; /** - * @see EclipsePlugin#deployName() + * @see org.apache.maven.plugin.eclipse.EclipsePlugin#deployName() */ private String contextName; /** - * @see EclipsePlugin#wtpapplicationxml() + * @see org.apache.maven.plugin.eclipse.EclipsePlugin#wtpapplicationxml() */ private boolean wtpapplicationxml; /** - * @see EclipsePlugin#getWtpversion() + * @see org.apache.maven.plugin.eclipse.EclipsePlugin#getWtpversion() */ private float wtpVersion; @@ -131,14 +131,14 @@ public class EclipseWriterConfig private WorkspaceConfiguration workspaceConfiguration; private List linkedResources; - + /** - * @See {@link EclipsePlugin#classpathContainersLast} + * @See {@link org.apache.maven.plugin.eclipse.EclipsePlugin#classpathContainersLast} */ private boolean classpathContainersLast; - + /** - * @see {@link EclipsePlugin#jeeversion} + * @see {@link org.apache.maven.plugin.eclipse.EclipsePlugin#jeeversion} */ private String jeeVersion; @@ -524,9 +524,9 @@ public class EclipseWriterConfig this.linkedResources = linkedResources; } - /** * Returns the classpathContainersLast. + * * @return the classpathContainersLast */ public boolean isClasspathContainersLast() @@ -534,18 +534,19 @@ public class EclipseWriterConfig return classpathContainersLast; } - /** * Sets the classpathContainersLast. + * * @param classpathContainersLast the classpathContainersLast to set */ - public void setClasspathContainersLast(boolean classpathContainersLast) + public void setClasspathContainersLast( boolean classpathContainersLast ) { this.classpathContainersLast = classpathContainersLast; } /** * Sets the jeeversion. + * * @return the jeeversion */ public String getJeeVersion() @@ -555,6 +556,7 @@ public class EclipseWriterConfig /** * Returns the jeeversion + * * @param jeeversion the jeeversion */ public void setJeeVersion( String jeeVersion ) Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/MonitoredResource.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/MonitoredResource.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/MonitoredResource.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/MonitoredResource.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers; /** * @author <a href="mailto:[email protected]">Kenney Westerhof</a> Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseHibernateWriter.java Fri Sep 25 21:53:36 2015 @@ -19,7 +19,6 @@ package org.apache.maven.plugin.eclipse. * under the License. */ - import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -116,7 +115,7 @@ public class MyEclipseHibernateWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } PrintWriter pw = new PrintWriter( w ); Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseMetadataWriter.java Fri Sep 25 21:53:36 2015 @@ -19,7 +19,6 @@ package org.apache.maven.plugin.eclipse. * under the License. */ - import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -95,7 +94,7 @@ public class MyEclipseMetadataWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); @@ -110,7 +109,7 @@ public class MyEclipseMetadataWriter // Find web application context root from maven-war-plugin configuration. // ArtifactId is used as the default value String warContextRoot = - IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN, "warContextRoot",//$NON-NLS-1$ + IdeUtils.getPluginSetting( config.getProject(), JeeUtils.ARTIFACT_MAVEN_WAR_PLUGIN, "warContextRoot", "/" + config.getProject().getArtifactId() ); writer.addAttribute( MYECLIPSE_METADATA_PROJECT_CONTEXT_ROOT, warContextRoot ); @@ -182,7 +181,8 @@ public class MyEclipseMetadataWriter else { jeeVersion = - JeeUtils.getJeeDescriptorFromServletVersion( JeeUtils.resolveServletVersion( config.getProject() ) ).getJeeVersion(); + JeeUtils.getJeeDescriptorFromServletVersion( + JeeUtils.resolveServletVersion( config.getProject() ) ).getJeeVersion(); } if ( jeeVersion == null ) Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseSpringBeansWriter.java Fri Sep 25 21:53:36 2015 @@ -19,7 +19,6 @@ package org.apache.maven.plugin.eclipse. * under the License. */ - import java.io.File; import java.io.FileFilter; import java.io.FileWriter; @@ -88,12 +87,12 @@ public class MyEclipseSpringBeansWriter FileWriter springFileWriter; try { - springFileWriter = - new FileWriter( new File( config.getEclipseProjectDirectory(), MYECLIPSE_SPRING_CONFIGURATION_FILENAME ) ); + springFileWriter = new FileWriter( new File( config.getEclipseProjectDirectory(), + MYECLIPSE_SPRING_CONFIGURATION_FILENAME ) ); } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( springFileWriter, "UTF-8", null ); @@ -113,14 +112,15 @@ public class MyEclipseSpringBeansWriter // do this with full path so it works as we descend through various modules (projects) File basedir = config.getEclipseProjectDirectory(); - for (Object o : getConfigurationFilesList(new File(basedir, (String) springConfig.get("basedir")), - (String) springConfig.get("file-pattern"))) { + for ( Object o : getConfigurationFilesList( new File( basedir, (String) springConfig.get( "basedir" ) ), + (String) springConfig.get( "file-pattern" ) ) ) + { String onConfigFileName = (String) o; - File onConfigFile = new File(onConfigFileName); - String relativeFileName = IdeUtils.toRelativeAndFixSeparator(basedir, onConfigFile, false); + File onConfigFile = new File( onConfigFileName ); + String relativeFileName = IdeUtils.toRelativeAndFixSeparator( basedir, onConfigFile, false ); - writer.startElement(MYECLIPSE_SPRING_CONFIG); - writer.writeText(relativeFileName); + writer.startElement( MYECLIPSE_SPRING_CONFIG ); + writer.writeText( relativeFileName ); writer.endElement(); } writer.endElement(); @@ -166,8 +166,9 @@ public class MyEclipseSpringBeansWriter if ( subdirs != null ) { - for (File subdir : subdirs) { - configFiles.addAll(getConfigurationFilesList(subdir, pattern)); + for ( File subdir : subdirs ) + { + configFiles.addAll( getConfigurationFilesList( subdir, pattern ) ); } } Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/myeclipse/MyEclipseStrutsDataWriter.java Fri Sep 25 21:53:36 2015 @@ -19,7 +19,6 @@ package org.apache.maven.plugin.eclipse. * under the License. */ - import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -97,7 +96,7 @@ public class MyEclipseStrutsDataWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java?rev=1705359&r1=1705358&r2=1705359&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/writers/rad/RadApplicationXMLWriter.java Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers.rad; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers.rad; import java.io.File; import java.io.FileInputStream; @@ -28,13 +29,10 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; -import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Constants; -import org.apache.maven.plugin.eclipse.EclipseSourceDir; import org.apache.maven.plugin.eclipse.Messages; import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter; -import org.apache.maven.plugin.eclipse.writers.wtp.AbstractWtpResourceWriter; import org.apache.maven.plugin.ide.IdeDependency; import org.apache.maven.plugin.ide.IdeUtils; import org.apache.maven.plugin.ide.JeeUtils; @@ -123,7 +121,6 @@ public class RadApplicationXMLWriter /** * write the application.xml and the .modulemaps file to the META-INF directory. * - * @see AbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File) * @param sourceDirs all eclipse source directorys * @param localRepository the local reposetory * @param buildOutputDirectory build output directory (target) @@ -158,8 +155,9 @@ public class RadApplicationXMLWriter new String[] { "modules", "webModule" } ); IdeDependency[] deps = config.getDeps(); - for (IdeDependency dep : deps) { - updateApplicationXml(applicationXmlDom, modulemapsXmlDom, dep); + for ( IdeDependency dep : deps ) + { + updateApplicationXml( applicationXmlDom, modulemapsXmlDom, dep ); } removeUnusedEntries( applicationXmlDom, modulemapsXmlDom ); @@ -230,9 +228,11 @@ public class RadApplicationXMLWriter { String id = getIdFromMapping( mapping ); Xpp3Dom[] children = applicationXmlDom.getChildren(); - for (Xpp3Dom aChildren : children) { - String childId = aChildren.getAttribute(ID); - if (childId != null && childId.equals(id)) { + for ( Xpp3Dom aChildren : children ) + { + String childId = aChildren.getAttribute( ID ); + if ( childId != null && childId.equals( id ) ) + { return aChildren; } } @@ -257,14 +257,14 @@ public class RadApplicationXMLWriter if ( dependency.getType().equals( Constants.PROJECT_PACKAGING_EJB ) && children[index].getName().equals( MODULEMAPS_MAPPINGS ) && children[index].getChild( APPLICATION_XML_MODULE ).getAttribute( XMI_TYPE ).equals( - MODULEMAPS_APPLICATION_EJB_MODULE ) ) + MODULEMAPS_APPLICATION_EJB_MODULE ) ) { return children[index]; } else if ( dependency.getType().equals( Constants.PROJECT_PACKAGING_WAR ) && children[index].getName().equals( MODULEMAPS_MAPPINGS ) - && children[index].getChild( APPLICATION_XML_MODULE ).getAttribute( XMI_TYPE ).equals( - MODULEMAPS_APPLICATION_WEB_MODULE ) ) + && children[index].getChild( APPLICATION_XML_MODULE ).getAttribute( XMI_TYPE ).equals( + MODULEMAPS_APPLICATION_WEB_MODULE ) ) { return children[index]; } @@ -392,24 +392,32 @@ public class RadApplicationXMLWriter */ private void removeUnusedEntries( Xpp3Dom applicationXmlDom, Xpp3Dom modulemapsXmlDom ) { - for (Xpp3Dom aModulemapsXmlDomChildren : this.modulemapsXmlDomChildren) { - if (aModulemapsXmlDomChildren != null) { + for ( Xpp3Dom aModulemapsXmlDomChildren : this.modulemapsXmlDomChildren ) + { + if ( aModulemapsXmlDomChildren != null ) + { Xpp3Dom[] newModulemapsXmlDomChildren = modulemapsXmlDom.getChildren(); - for (int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++) { - if ((newModulemapsXmlDomChildren[newIndex] != null) - && (newModulemapsXmlDomChildren[newIndex] == aModulemapsXmlDomChildren)) { - modulemapsXmlDom.removeChild(newIndex); + for ( int newIndex = 0; newIndex < newModulemapsXmlDomChildren.length; newIndex++ ) + { + if ( ( newModulemapsXmlDomChildren[newIndex] != null ) + && ( newModulemapsXmlDomChildren[newIndex] == aModulemapsXmlDomChildren ) ) + { + modulemapsXmlDom.removeChild( newIndex ); break; } } } } - for (Xpp3Dom anApplicationXmlDomChildren : this.applicationXmlDomChildren) { - if (anApplicationXmlDomChildren != null) { + for ( Xpp3Dom anApplicationXmlDomChildren : this.applicationXmlDomChildren ) + { + if ( anApplicationXmlDomChildren != null ) + { Xpp3Dom[] newApplicationXmlDomChildren = applicationXmlDom.getChildren(); - for (int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++) { - if (newApplicationXmlDomChildren[newIndex] == anApplicationXmlDomChildren) { - applicationXmlDom.removeChild(newIndex); + for ( int newIndex = 0; newIndex < newApplicationXmlDomChildren.length; newIndex++ ) + { + if ( newApplicationXmlDomChildren[newIndex] == anApplicationXmlDomChildren ) + { + applicationXmlDom.removeChild( newIndex ); break; } } @@ -474,11 +482,10 @@ public class RadApplicationXMLWriter else { handled( module ); - module.getChild( APPLICATION_XML_WEB ).getChild( APPLICATION_XML_WEB_URI ).setValue( - dependency.getArtifactId() - + ".war" ); - module.getChild( APPLICATION_XML_WEB ).getChild( APPLICATION_XML_CONTEXT_ROOT ).setValue( - contextRootInPom ); + module.getChild( APPLICATION_XML_WEB ).getChild( APPLICATION_XML_WEB_URI ).setValue( + dependency.getArtifactId() + ".war" ); + module.getChild( APPLICATION_XML_WEB ).getChild( APPLICATION_XML_CONTEXT_ROOT ).setValue( + contextRootInPom ); } } } @@ -492,9 +499,12 @@ public class RadApplicationXMLWriter */ private String getContextRootFor( String artifactId ) { - for (Xpp3Dom webModulesFromPom : webModulesFromPoms) { - if (webModulesFromPom.getChild("artifactId").getValue().equals(artifactId)) - return new File(webModulesFromPom.getChild("contextRoot").getValue()).getName(); + for ( Xpp3Dom webModulesFromPom : webModulesFromPoms ) + { + if ( webModulesFromPom.getChild( "artifactId" ).getValue().equals( artifactId ) ) + { + return new File( webModulesFromPom.getChild( "contextRoot" ).getValue() ).getName(); + } } return artifactId; } @@ -523,7 +533,7 @@ public class RadApplicationXMLWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); Xpp3DomWriter.write( writer, xmlDomTree ); 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=1705359&r1=1705358&r2=1705359&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 Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers.rad; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers.rad; import java.io.File; import java.io.FileInputStream; @@ -30,13 +31,10 @@ import java.io.Writer; import java.util.Arrays; import java.util.Comparator; -import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Constants; -import org.apache.maven.plugin.eclipse.EclipseSourceDir; import org.apache.maven.plugin.eclipse.Messages; import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter; -import org.apache.maven.plugin.eclipse.writers.wtp.AbstractWtpResourceWriter; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter; import org.codehaus.plexus.util.xml.XMLWriter; @@ -82,7 +80,6 @@ public class RadEjbClasspathWriter /** * 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) @@ -103,9 +100,11 @@ public class RadEjbClasspathWriter } Xpp3Dom classpath = readXMLFile( classpathFile ); Xpp3Dom[] children = classpath.getChildren(); - for (Xpp3Dom aChildren : children) { - if (LIB.equals(aChildren.getAttribute(KIND)) - && TARGET_WEBSPHERE_CLASSES.equals(aChildren.getAttribute("path"))) { + for ( Xpp3Dom aChildren : children ) + { + if ( LIB.equals( aChildren.getAttribute( KIND ) ) + && TARGET_WEBSPHERE_CLASSES.equals( aChildren.getAttribute( "path" ) ) ) + { return; // nothing to do! } } @@ -139,7 +138,7 @@ public class RadEjbClasspathWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); Xpp3DomWriter.write( writer, classpath ); @@ -217,8 +216,9 @@ public class RadEjbClasspathWriter } } ); Xpp3Dom resultClasspath = new Xpp3Dom( CLASSPATH ); - for (Xpp3Dom aChildren : children) { - resultClasspath.addChild(aChildren); + for ( Xpp3Dom aChildren : children ) + { + resultClasspath.addChild( aChildren ); } return resultClasspath; } 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=1705359&r1=1705358&r2=1705359&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 Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers.rad; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,7 +18,6 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers.rad; import java.io.File; import java.io.FileOutputStream; @@ -24,13 +25,10 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; -import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Constants; -import org.apache.maven.plugin.eclipse.EclipseSourceDir; import org.apache.maven.plugin.eclipse.Messages; import org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter; -import org.apache.maven.plugin.eclipse.writers.wtp.AbstractWtpResourceWriter; import org.apache.maven.plugin.ide.JeeUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter; @@ -57,7 +55,6 @@ public class RadJ2EEWriter /** * 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) @@ -81,7 +78,7 @@ public class RadJ2EEWriter } catch ( IOException ex ) { - throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); //$NON-NLS-1$ + throw new MojoExecutionException( Messages.getString( "EclipsePlugin.erroropeningfile" ), ex ); } XMLWriter writer = new PrettyPrintXMLWriter( w, "UTF-8", null ); 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=1705359&r1=1705358&r2=1705359&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 Fri Sep 25 21:53:36 2015 @@ -1,3 +1,5 @@ +package org.apache.maven.plugin.eclipse.writers.rad; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,12 +18,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.maven.plugin.eclipse.writers.rad; import java.io.File; import java.io.IOException; -import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.eclipse.Constants; import org.apache.maven.plugin.eclipse.Messages; @@ -70,8 +70,6 @@ public class RadLibCopier * @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 @@ -79,15 +77,18 @@ public class RadLibCopier String[] oldFiles = FileUtils.getFilesFromExtension( destDir.getAbsolutePath(), new String[] { Constants.PROJECT_PACKAGING_JAR } ); - for (String oldFile : oldFiles) { - if (!new File(oldFile).delete()) { - log.error(Messages.getString("Rad6LibCopier.cantdeletefile", new Object[]{oldFile})); + for ( String oldFile : oldFiles ) + { + if ( !new File( oldFile ).delete() ) + { + log.error( Messages.getString( "Rad6LibCopier.cantdeletefile", new Object[] { oldFile } ) ); } } - for (IdeDependency dep : deps) { - if (!dep.isTestDependency() && !dep.isProvided() && !dep.isReferencedProject() - && !dep.isSystemScoped()) { - copyFile(dep.getFile(), new File(destDir, dep.getFile().getName()), log); + for ( IdeDependency dep : deps ) + { + if ( !dep.isTestDependency() && !dep.isProvided() && !dep.isReferencedProject() && !dep.isSystemScoped() ) + { + copyFile( dep.getFile(), new File( destDir, dep.getFile().getName() ), log ); } } }
