Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/SaveWebappStructurePostPackagingTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/SaveWebappStructurePostPackagingTask.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/SaveWebappStructurePostPackagingTask.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/SaveWebappStructurePostPackagingTask.java Wed Oct 1 22:03:26 2014 @@ -30,7 +30,6 @@ import java.io.IOException; * Saves the webapp structure cache. * * @author Stephane Nicoll - * * @version $Id$ */ public class SaveWebappStructurePostPackagingTask @@ -41,7 +40,6 @@ public class SaveWebappStructurePostPack private final WebappStructureSerializer serialier; - public SaveWebappStructurePostPackagingTask( File targetFile ) { this.targetFile = targetFile;
Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingContext.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingContext.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingContext.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingContext.java Wed Oct 1 22:03:26 2014 @@ -49,8 +49,7 @@ public interface WarPackagingContext MavenProject getProject(); /** - * Returns the webapp directory. Packaging tasks should use this - * directory to generate the webapp. + * Returns the webapp directory. Packaging tasks should use this directory to generate the webapp. * * @return the webapp directory */ @@ -92,8 +91,7 @@ public interface WarPackagingContext File getClassesDirectory(); /** - * Specify whether the classes resources should be archived in - * the <tt>WEB-INF/lib</tt> of the generated web app. + * Specify whether the classes resources should be archived in the <tt>WEB-INF/lib</tt> of the generated web app. * * @return true if the classes should be archived, false otherwise */ @@ -128,16 +126,14 @@ public interface WarPackagingContext MavenArchiveConfiguration getArchive(); /** - * Returns the Jar archiver needed for archiving classes directory into - * jar file under WEB-INF/lib. + * Returns the Jar archiver needed for archiving classes directory into jar file under WEB-INF/lib. * * @return the jar archiver to user */ JarArchiver getJarArchiver(); /** - * Returns the output file name mapping to use, if any. Returns <tt>null</tt> - * if no file name mapping is set. + * Returns the output file name mapping to use, if any. Returns <tt>null</tt> if no file name mapping is set. * * @return the output file name mapping or <tt>null</tt> */ @@ -158,15 +154,14 @@ public interface WarPackagingContext WebappStructure getWebappStructure(); /** - * Returns the list of registered overlays for this session. This list might - * differ from the one returned by the cache; in this case, it means that the - * project's configuration has changed. The plugin will handle those cases nicely - * but it would be better in general to invoke the clean goal. + * Returns the list of registered overlays for this session. This list might differ from the one returned by the + * cache; in this case, it means that the project's configuration has changed. The plugin will handle those cases + * nicely but it would be better in general to invoke the clean goal. * * @return the list of registered overlays, including the current project */ List<String> getOwnerIds(); - + /** * Returns the {@link MavenFileFilter} instance to use. * @@ -174,25 +169,24 @@ public interface WarPackagingContext * @since 2.1-alpha-2 */ MavenFileFilter getMavenFileFilter(); - + /** * @return {@link List} of {@link FilterWrapper} * @since 2.1-alpha-2 */ List<FilterWrapper> getFilterWrappers(); - + /** - * Specify if the given <tt>fileName</tt> belongs to the list of extensions - * that must not be filtered + * Specify if the given <tt>fileName</tt> belongs to the list of extensions that must not be filtered * * @param fileName the name of file * @return <tt>true</tt> if it should not be filtered, <tt>false</tt> otherwise * @since 2.1-alpha-2 */ boolean isNonFilteredExtension( String fileName ); - + boolean isFilteringDeploymentDescriptors(); - + ArtifactFactory getArtifactFactory(); /** @@ -212,7 +206,6 @@ public interface WarPackagingContext String getResourceEncoding(); /** - * * @return to use jvmChmod rather than forking chmod cli * @since 2.4 */ Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingTask.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingTask.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingTask.java Wed Oct 1 22:03:26 2014 @@ -34,15 +34,13 @@ public interface WarPackagingTask /** * Performs the packaging for the specified task. * <p/> - * The task is responsible to update the packaging context, namely - * with the files that have been copied. + * The task is responsible to update the packaging context, namely with the files that have been copied. * * @param context the packaging context * @throws MojoExecutionException if an error occurred - * @throws MojoFailureException if the project configuration is invalid + * @throws MojoFailureException if the project configuration is invalid */ void performPackaging( WarPackagingContext context ) throws MojoExecutionException, MojoFailureException; - } Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPostPackagingTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPostPackagingTask.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPostPackagingTask.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPostPackagingTask.java Wed Oct 1 22:03:26 2014 @@ -34,12 +34,11 @@ public interface WarPostPackagingTask /** * Executes the post packaging task. * <p/> - * The packaging context hold all information regarding the webapp that - * has been packaged. + * The packaging context hold all information regarding the webapp that has been packaged. * * @param context the packaging context * @throws MojoExecutionException if an error occurred - * @throws MojoFailureException if a failure occurred + * @throws MojoFailureException if a failure occurred */ void performPostPackaging( WarPackagingContext context ) throws MojoExecutionException, MojoFailureException; Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java Wed Oct 1 22:03:26 2014 @@ -32,14 +32,9 @@ import org.codehaus.plexus.util.Director import org.codehaus.plexus.util.StringUtils; /** - * Handles the project own resources, that is: - * <ul - * <li>The list of web resources, if any</li> - * <li>The content of the webapp directory if it exists</li> - * <li>The custom deployment descriptor(s), if any</li> - * <li>The content of the classes directory if it exists</li> - * <li>The dependencies of the project</li> - * </ul> + * Handles the project own resources, that is: <ul <li>The list of web resources, if any</li> <li>The content of the + * webapp directory if it exists</li> <li>The custom deployment descriptor(s), if any</li> <li>The content of the + * classes directory if it exists</li> <li>The dependencies of the project</li> </ul> * * @author Stephane Nicoll * @version $Id$ @@ -57,7 +52,6 @@ public class WarProjectPackagingTask private Overlay currentProjectOverlay; - public WarProjectPackagingTask( Resource[] webResources, File webXml, File containerConfigXml, Overlay currentProjectOverlay ) { @@ -106,7 +100,6 @@ public class WarProjectPackagingTask handleArtifacts( context ); } - /** * Handles the web resources. * @@ -159,8 +152,7 @@ public class WarProjectPackagingTask { context.getLog().debug( "webapp sources directory does not exist - skipping." ); } - else if ( !context.getWebappSourceDirectory().getAbsolutePath().equals( - context.getWebappDirectory().getPath() ) ) + else if ( !context.getWebappSourceDirectory().getAbsolutePath().equals( context.getWebappDirectory().getPath() ) ) { context.getLog().info( "Copying webapp resources [" + context.getWebappSourceDirectory() + "]" ); final PathSet sources = @@ -173,8 +165,8 @@ public class WarProjectPackagingTask } catch ( IOException e ) { - throw new MojoExecutionException( - "Could not copy webapp sources [" + context.getWebappDirectory().getAbsolutePath() + "]", e ); + throw new MojoExecutionException( "Could not copy webapp sources [" + + context.getWebappDirectory().getAbsolutePath() + "]", e ); } } } @@ -189,8 +181,8 @@ public class WarProjectPackagingTask throws MojoExecutionException { @SuppressWarnings( "unchecked" ) - ArtifactsPackagingTask task = new ArtifactsPackagingTask( context.getProject().getArtifacts(), - currentProjectOverlay ); + ArtifactsPackagingTask task = + new ArtifactsPackagingTask( context.getProject().getArtifacts(), currentProjectOverlay ); task.performPackaging( context ); } @@ -208,14 +200,13 @@ public class WarProjectPackagingTask } /** - * Handles the deployment descriptors, if specified. Note that the behavior - * here is slightly different since the customized entry always win, even if - * an overlay has already packaged a web.xml previously. + * Handles the deployment descriptors, if specified. Note that the behavior here is slightly different since the + * customized entry always win, even if an overlay has already packaged a web.xml previously. * - * @param context the packaging context - * @param webinfDir the web-inf directory + * @param context the packaging context + * @param webinfDir the web-inf directory * @param metainfDir the meta-inf directory - * @throws MojoFailureException if the web.xml is specified but does not exist + * @throws MojoFailureException if the web.xml is specified but does not exist * @throws MojoExecutionException if an error occurred while copying the descriptors */ protected void handleDeploymentDescriptors( WarPackagingContext context, File webinfDir, File metainfDir ) @@ -270,8 +261,8 @@ public class WarProjectPackagingTask } else { - copyFile( context, containerConfigXML, new File( metainfDir, xmlFileName ), - "META-INF/" + xmlFileName, true ); + copyFile( context, containerConfigXML, new File( metainfDir, xmlFileName ), "META-INF/" + + xmlFileName, true ); } } } @@ -288,9 +279,9 @@ public class WarProjectPackagingTask /** * Copies webapp webResources from the specified directory. * - * @param context the WAR packaging context to use + * @param context the WAR packaging context to use * @param resource the resource to copy - * @throws IOException if an error occurred while copying the resources + * @throws IOException if an error occurred while copying the resources * @throws MojoExecutionException if an error occurred while retrieving the filter properties */ public void copyResources( WarPackagingContext context, Resource resource ) @@ -298,38 +289,42 @@ public class WarProjectPackagingTask { if ( !context.getWebappDirectory().exists() ) { - context.getLog().warn( - "Not copying webapp webResources [" + resource.getDirectory() + "]: webapp directory [" - + context.getWebappDirectory().getAbsolutePath() + "] does not exist!" ); + context.getLog().warn( "Not copying webapp webResources [" + resource.getDirectory() + + "]: webapp directory [" + context.getWebappDirectory().getAbsolutePath() + + "] does not exist!" ); } context.getLog().info( "Copying webapp webResources [" + resource.getDirectory() + "] to [" - + context.getWebappDirectory().getAbsolutePath() + "]" ); + + context.getWebappDirectory().getAbsolutePath() + "]" ); String[] fileNames = getFilesToCopy( resource ); - for (String fileName : fileNames) { + for ( String fileName : fileNames ) + { String targetFileName = fileName; - if (resource.getTargetPath() != null) { - //TODO make sure this thing is 100% safe + if ( resource.getTargetPath() != null ) + { + // TODO make sure this thing is 100% safe // MWAR-129 if targetPath is only a dot <targetPath>.</targetPath> or ./ // and the Resource is in a part of the warSourceDirectory the file from sources will override this // that's we don't have to add the targetPath yep not nice but works - if (!StringUtils.equals(".", resource.getTargetPath()) - && !StringUtils.equals("./", resource.getTargetPath())) { + if ( !StringUtils.equals( ".", resource.getTargetPath() ) + && !StringUtils.equals( "./", resource.getTargetPath() ) ) + { targetFileName = resource.getTargetPath() + File.separator + targetFileName; } } - if (resource.isFiltering() && !context.isNonFilteredExtension(fileName)) { - copyFilteredFile(id, context, new File(resource.getDirectory(), fileName), targetFileName); - } else { - copyFile(id, context, new File(resource.getDirectory(), fileName), targetFileName); + if ( resource.isFiltering() && !context.isNonFilteredExtension( fileName ) ) + { + copyFilteredFile( id, context, new File( resource.getDirectory(), fileName ), targetFileName ); + } + else + { + copyFile( id, context, new File( resource.getDirectory(), fileName ), targetFileName ); } } } - /** - * Returns a list of filenames that should be copied - * over to the destination directory. + * Returns a list of filenames that should be copied over to the destination directory. * * @param resource the resource to be scanned * @return the array of filenames, relative to the sourceDir @@ -340,8 +335,7 @@ public class WarProjectPackagingTask scanner.setBasedir( resource.getDirectory() ); if ( resource.getIncludes() != null && !resource.getIncludes().isEmpty() ) { - scanner.setIncludes( - (String[]) resource.getIncludes().toArray( new String[resource.getIncludes().size()] ) ); + scanner.setIncludes( (String[]) resource.getIncludes().toArray( new String[resource.getIncludes().size()] ) ); } else { @@ -349,8 +343,7 @@ public class WarProjectPackagingTask } if ( resource.getExcludes() != null && !resource.getExcludes().isEmpty() ) { - scanner.setExcludes( - (String[]) resource.getExcludes().toArray( new String[resource.getExcludes().size()] ) ); + scanner.setExcludes( (String[]) resource.getExcludes().toArray( new String[resource.getExcludes().size()] ) ); } scanner.addDefaultExcludes(); Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/ClassesPackager.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/ClassesPackager.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/ClassesPackager.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/ClassesPackager.java Wed Oct 1 22:03:26 2014 @@ -53,11 +53,11 @@ public class ClassesPackager /** * Package the classes * - * @param classesDirectory the classes directory - * @param targetFile the target file - * @param jarArchiver the jar archiver to use - * @param session the current session - * @param project the related project + * @param classesDirectory the classes directory + * @param targetFile the target file + * @param jarArchiver the jar archiver to use + * @param session the current session + * @param project the related project * @param archiveConfiguration the archive configuration to use * @throws MojoExecutionException if an error occurred while creating the archive */ Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/DependencyInfo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/DependencyInfo.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/DependencyInfo.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/DependencyInfo.java Wed Oct 1 22:03:26 2014 @@ -30,7 +30,6 @@ import org.apache.maven.model.Dependency public class DependencyInfo { - private final Dependency dependency; private String targetFileName; @@ -56,8 +55,7 @@ public class DependencyInfo } /** - * Returns the target filen ame of the dependency. If no target file name - * is associated, returns <tt>null</tt>. + * Returns the target filen ame of the dependency. If no target file name is associated, returns <tt>null</tt>. * * @return the target file name or <tt>null</tt> */ Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/PathSet.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/PathSet.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/PathSet.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/PathSet.java Wed Oct 1 22:03:26 2014 @@ -32,15 +32,15 @@ import java.util.Set; /** * Set of file's paths. * <p/> - * The class extends functionality of a "normal" set of strings by a process of - * the paths normalization. All paths are converted to unix form (slashes) and - * they don't start with starting /. + * The class extends functionality of a "normal" set of strings by a process of the paths normalization. All paths are + * converted to unix form (slashes) and they don't start with starting /. * * @author Piotr Tabor * @version $Id$ */ -public class PathSet implements Iterable<String> +public class PathSet + implements Iterable<String> { /** @@ -71,12 +71,11 @@ public class PathSet implements Iterable */ public PathSet() { - /*Empty default constructor*/ + /* Empty default constructor */ } /** - * Creates paths set and normalizate and adds all 'paths'. - * The source 'paths' will not be changed + * Creates paths set and normalizate and adds all 'paths'. The source 'paths' will not be changed * * @param paths to be added */ @@ -86,8 +85,7 @@ public class PathSet implements Iterable } /** - * Creates paths set and normalizate and adds all 'paths'. - * The source 'paths' will not be changed + * Creates paths set and normalizate and adds all 'paths'. The source 'paths' will not be changed * * @param paths to be added */ @@ -107,10 +105,9 @@ public class PathSet implements Iterable } /** - * Normalizes and adds given paths (collection of strings) - * to the set. The source collection will not be changed + * Normalizes and adds given paths (collection of strings) to the set. The source collection will not be changed * - * @param paths - collection of strings to be added + * @param paths - collection of strings to be added * @param prefix added to all given paths */ public void addAll( Collection<String> paths, String prefix ) @@ -122,10 +119,9 @@ public class PathSet implements Iterable } /** - * Normalizes and adds given paths to the set. - * The source collection will not be changed + * Normalizes and adds given paths to the set. The source collection will not be changed * - * @param paths to be added + * @param paths to be added * @param prefix added to all given paths */ public void addAll( String[] paths, String prefix ) @@ -137,10 +133,9 @@ public class PathSet implements Iterable } /** - * Adds given paths to the set. - * The source collection will not be changed + * Adds given paths to the set. The source collection will not be changed * - * @param paths to be added + * @param paths to be added * @param prefix added to all given paths */ public void addAll( PathSet paths, String prefix ) @@ -152,8 +147,7 @@ public class PathSet implements Iterable } /** - * Normalizes and adds given paths (collection of strings) - * to the set. The source collection will not be changed + * Normalizes and adds given paths (collection of strings) to the set. The source collection will not be changed * * @param paths - collection of strings to be added */ @@ -163,8 +157,7 @@ public class PathSet implements Iterable } /** - * Normalizes and adds given paths to the set. - * The source collection will not be changed + * Normalizes and adds given paths to the set. The source collection will not be changed * * @param paths to be added */ @@ -174,8 +167,7 @@ public class PathSet implements Iterable } /** - * Adds given paths to the set. - * The source collection will not be changed + * Adds given paths to the set. The source collection will not be changed * * @param paths to be added */ @@ -185,8 +177,7 @@ public class PathSet implements Iterable } /** - * Checks if the set constains given path. The path is normalized - * before check. + * Checks if the set constains given path. The path is normalized before check. * * @param path we are looking for in the set. * @return information if the set constains the path. @@ -255,7 +246,7 @@ public class PathSet implements Iterable * Adds to the set all files in the given directory * * @param directory that will be searched for file's paths to add - * @param prefix to be added to all found files + * @param prefix to be added to all found files */ public void addAllFilesInDirectory( File directory, String prefix ) { Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java Wed Oct 1 22:03:26 2014 @@ -25,25 +25,28 @@ import org.apache.maven.project.MavenPro import org.codehaus.plexus.util.StringUtils; /** - * * @author Stephane Nicoll * @version $Id$ */ public class WarUtils { - public static Artifact getArtifact( MavenProject project, Dependency dependency ) { - for (Object o : project.getArtifacts()) { + for ( Object o : project.getArtifacts() ) + { Artifact artifact = (Artifact) o; - if (artifact.getGroupId().equals(dependency.getGroupId()) - && artifact.getArtifactId().equals(dependency.getArtifactId()) - && artifact.getType().equals(dependency.getType())) { - if (artifact.getClassifier() == null && dependency.getClassifier() == null) { + if ( artifact.getGroupId().equals( dependency.getGroupId() ) + && artifact.getArtifactId().equals( dependency.getArtifactId() ) + && artifact.getType().equals( dependency.getType() ) ) + { + if ( artifact.getClassifier() == null && dependency.getClassifier() == null ) + { return artifact; - } else if (dependency.getClassifier() != null - && dependency.getClassifier().equals(artifact.getClassifier())) { + } + else if ( dependency.getClassifier() != null + && dependency.getClassifier().equals( artifact.getClassifier() ) ) + { return artifact; } } @@ -67,22 +70,22 @@ public class WarUtils return false; } if ( artifact.getVersion() != null ? !artifact.getVersion().equals( dependency.getVersion() ) - : dependency.getVersion() != null ) + : dependency.getVersion() != null ) { return false; } if ( artifact.getType() != null ? !artifact.getType().equals( dependency.getType() ) - : dependency.getType() != null ) + : dependency.getType() != null ) { return false; } if ( artifact.getClassifier() != null ? !artifact.getClassifier().equals( dependency.getClassifier() ) - : dependency.getClassifier() != null ) + : dependency.getClassifier() != null ) { return false; } if ( artifact.getScope() != null ? !artifact.getScope().equals( dependency.getScope() ) - : dependency.getScope() != null ) + : dependency.getScope() != null ) { return false; } @@ -110,12 +113,12 @@ public class WarUtils return false; } if ( first.getClassifier() != null ? !first.getClassifier().equals( second.getClassifier() ) - : second.getClassifier() != null ) + : second.getClassifier() != null ) { return false; } if ( first.getExclusions() != null ? !first.getExclusions().equals( second.getExclusions() ) - : second.getExclusions() != null ) + : second.getExclusions() != null ) { return false; } @@ -128,7 +131,7 @@ public class WarUtils return false; } if ( first.getSystemPath() != null ? !first.getSystemPath().equals( second.getSystemPath() ) - : second.getSystemPath() != null ) + : second.getSystemPath() != null ) { return false; } @@ -137,12 +140,11 @@ public class WarUtils return false; } if ( first.getVersion() != null ? !first.getVersion().equals( second.getVersion() ) - : second.getVersion() != null ) + : second.getVersion() != null ) { return false; } return true; } - } Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java Wed Oct 1 22:03:26 2014 @@ -33,12 +33,10 @@ import java.util.Map; import java.util.Set; /** - * Represents the structure of a web application composed of multiple - * overlays. Each overlay is registered within this structure with the - * set of files it holds. + * Represents the structure of a web application composed of multiple overlays. Each overlay is registered within this + * structure with the set of files it holds. * <p/> - * Note that this structure is persisted to disk at each invocation to - * store which owner holds which path (file). + * Note that this structure is persisted to disk at each invocation to store which owner holds which path (file). * * @author Stephane Nicoll * @version $Id$ @@ -70,7 +68,7 @@ public class WebappStructure * Creates a new instance with the specified cache. * * @param dependencies the dependencies of the project - * @param cache the cache + * @param cache the cache */ public WebappStructure( List<Dependency> dependencies, WebappStructure cache ) { @@ -115,7 +113,6 @@ public class WebappStructure return result; } - /** * Specify if the specified <tt>path</tt> is registered or not. * @@ -129,10 +126,10 @@ public class WebappStructure } /** - * Registers the specified path for the specified owner. Returns <tt>true</tt> - * if the path is not already registered, <tt>false</tt> otherwise. + * Registers the specified path for the specified owner. Returns <tt>true</tt> if the path is not already + * registered, <tt>false</tt> otherwise. * - * @param id the owner of the path + * @param id the owner of the path * @param path the relative path from the webapp root directory * @return true if the file was registered successfully */ @@ -150,16 +147,14 @@ public class WebappStructure } /** - * Forces the registration of the specified path for the specified owner. If - * the file is not registered yet, a simple registration is performed. If the - * file already exists, the owner changes to the specified one. + * Forces the registration of the specified path for the specified owner. If the file is not registered yet, a + * simple registration is performed. If the file already exists, the owner changes to the specified one. * <p/> - * Beware that the semantic of the return boolean is different than the one - * from {@link #registerFile(String, String)}; returns <tt>true</tt> if an - * owner replacement was made and <tt>false</tt> if the file was simply registered - * for the first time. + * Beware that the semantic of the return boolean is different than the one from + * {@link #registerFile(String, String)}; returns <tt>true</tt> if an owner replacement was made and <tt>false</tt> + * if the file was simply registered for the first time. * - * @param id the owner of the path + * @param id the owner of the path * @param path the relative path from the webapp root directory * @return false if the file did not exist, true if the owner was replaced */ @@ -181,11 +176,11 @@ public class WebappStructure } /** - * Registers the specified path for the specified owner. Invokes - * the <tt>callback</tt> with the result of the registration. + * Registers the specified path for the specified owner. Invokes the <tt>callback</tt> with the result of the + * registration. * - * @param id the owner of the path - * @param path the relative path from the webapp root directory + * @param id the owner of the path + * @param path the relative path from the webapp root directory * @param callback the callback to invoke with the result of the registration * @throws IOException if the callback invocation throws an IOException */ @@ -223,8 +218,7 @@ public class WebappStructure } /** - * Returns the owner of the specified <tt>path</tt>. If the file is not - * registered, returns <tt>null</tt> + * Returns the owner of the specified <tt>path</tt>. If the file is not registered, returns <tt>null</tt> * * @param path the relative path from the webapp root directory * @return the owner or <tt>null</tt>. @@ -246,20 +240,18 @@ public class WebappStructure } } - throw new IllegalStateException( - "Should not happen, path [" + path + "] is flagged as being registered but was not found." ); + throw new IllegalStateException( "Should not happen, path [" + path + + "] is flagged as being registered but was not found." ); } } /** - * Returns the owners. Note that this the returned {@link Set} may be - * inconsistent since it represents a persistent cache across multiple - * invocations. + * Returns the owners. Note that this the returned {@link Set} may be inconsistent since it represents a persistent + * cache across multiple invocations. * <p/> - * For instance, if an overlay was removed in this execution, it will be - * still be there till the cache is cleaned. This happens when the clean - * mojo is invoked. + * For instance, if an overlay was removed in this execution, it will be still be there till the cache is cleaned. + * This happens when the clean mojo is invoked. * * @return the list of owners */ @@ -295,7 +287,6 @@ public class WebappStructure return pathSet; } - /** * Analyze the dependencies of the project using the specified callback. * @@ -373,14 +364,14 @@ public class WebappStructure /** * Registers the target file name for the specified artifact. * - * @param artifact the artifact + * @param artifact the artifact * @param targetFileName the target file name */ public void registerTargetFileName( Artifact artifact, String targetFileName ) { if ( dependenciesInfo != null ) { - for ( DependencyInfo dependencyInfo : dependenciesInfo ) + for ( DependencyInfo dependencyInfo : dependenciesInfo ) { if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) ) { @@ -391,11 +382,10 @@ public class WebappStructure } /** - * Returns the cached target file name that matches the specified - * dependency, that is the target file name of the previous run. + * Returns the cached target file name that matches the specified dependency, that is the target file name of the + * previous run. * <p/> - * The dependency object may have changed so the comparison is - * based on basic attributes of the dependency. + * The dependency object may have changed so the comparison is based on basic attributes of the dependency. * * @param dependency a dependency * @return the target file name of the last run for this dependency @@ -406,7 +396,7 @@ public class WebappStructure { return null; } - for ( DependencyInfo dependencyInfo : cache.getDependenciesInfo() ) + for ( DependencyInfo dependencyInfo : cache.getDependenciesInfo() ) { final Dependency dependency2 = dependencyInfo.getDependency(); if ( StringUtils.equals( dependency.getGroupId(), dependency2.getGroupId() ) @@ -433,7 +423,7 @@ public class WebappStructure /** * Find a dependency that is similar from the specified dependency. * - * @param dependency the dependency to find + * @param dependency the dependency to find * @param dependencies a list of dependencies * @return a similar dependency or <tt>null</tt> if no similar dependency is found */ @@ -444,7 +434,9 @@ public class WebappStructure if ( dependency.getGroupId().equals( dep.getGroupId() ) && dependency.getArtifactId().equals( dep.getArtifactId() ) && dependency.getType().equals( dep.getType() ) - && ( ( dependency.getClassifier() == null && dep.getClassifier() == null ) || ( dependency.getClassifier() != null && dependency.getClassifier().equals( dep.getClassifier() ) ) ) ) + && ( + ( dependency.getClassifier() == null && dep.getClassifier() == null ) + || ( dependency.getClassifier() != null && dependency.getClassifier().equals( dep.getClassifier() ) ) ) ) { return dep; } @@ -454,7 +446,7 @@ public class WebappStructure private Dependency matchDependency( List<Dependency> dependencies, Dependency dependency ) { - for ( Dependency dep : dependencies) + for ( Dependency dep : dependencies ) { if ( WarUtils.dependencyEquals( dep, dependency ) ) { @@ -465,7 +457,6 @@ public class WebappStructure return null; } - private List<DependencyInfo> createDependenciesInfoList( List<Dependency> dependencies ) { if ( dependencies == null ) @@ -473,14 +464,13 @@ public class WebappStructure return Collections.emptyList(); } final List<DependencyInfo> result = new ArrayList<DependencyInfo>(); - for ( Dependency dependency : dependencies ) + for ( Dependency dependency : dependencies ) { result.add( new DependencyInfo( dependency ) ); } return result; } - private Object readResolve() { // the full structure should be resolved so let's rebuild it @@ -493,21 +483,17 @@ public class WebappStructure } /** - * Callback interface to handle events related to filepath registration in - * the webapp. + * Callback interface to handle events related to filepath registration in the webapp. */ public interface RegistrationCallback { - /** - * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> - * has been registered successfully. + * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> has been registered successfully. * <p/> - * This means that the <tt>targetFilename</tt> was unknown and has been - * registered successfully. + * This means that the <tt>targetFilename</tt> was unknown and has been registered successfully. * - * @param ownerId the ownerId + * @param ownerId the ownerId * @param targetFilename the relative path according to the root of the webapp * @throws IOException if an error occurred while handling this event */ @@ -515,13 +501,11 @@ public class WebappStructure throws IOException; /** - * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> - * has already been registered. + * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> has already been registered. * <p/> - * This means that the <tt>targetFilename</tt> was known and belongs to the - * specified owner. + * This means that the <tt>targetFilename</tt> was known and belongs to the specified owner. * - * @param ownerId the ownerId + * @param ownerId the ownerId * @param targetFilename the relative path according to the root of the webapp * @throws IOException if an error occurred while handling this event */ @@ -529,32 +513,28 @@ public class WebappStructure throws IOException; /** - * Called if the registration of the <tt>targetFilename</tt> for the - * specified <tt>ownerId</tt> has been refused since the path already - * belongs to the <tt>actualOwnerId</tt>. + * Called if the registration of the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> has been refused + * since the path already belongs to the <tt>actualOwnerId</tt>. * <p/> - * This means that the <tt>targetFilename</tt> was known and does not - * belong to the specified owner. + * This means that the <tt>targetFilename</tt> was known and does not belong to the specified owner. * - * @param ownerId the ownerId + * @param ownerId the ownerId * @param targetFilename the relative path according to the root of the webapp - * @param actualOwnerId the actual owner + * @param actualOwnerId the actual owner * @throws IOException if an error occurred while handling this event */ void refused( String ownerId, String targetFilename, String actualOwnerId ) throws IOException; /** - * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> - * has been registered successfully by superseding a <tt>deprecatedOwnerId</tt>, - * that is the previous owner of the file. + * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> has been registered successfully by + * superseding a <tt>deprecatedOwnerId</tt>, that is the previous owner of the file. * <p/> - * This means that the <tt>targetFilename</tt> was known but for another - * owner. This usually happens after a project's configuration change. As a - * result, the file has been registered successfully to the new owner. + * This means that the <tt>targetFilename</tt> was known but for another owner. This usually happens after a + * project's configuration change. As a result, the file has been registered successfully to the new owner. * - * @param ownerId the ownerId - * @param targetFilename the relative path according to the root of the webapp + * @param ownerId the ownerId + * @param targetFilename the relative path according to the root of the webapp * @param deprecatedOwnerId the previous owner that does not exist anymore * @throws IOException if an error occurred while handling this event */ @@ -562,15 +542,13 @@ public class WebappStructure throws IOException; /** - * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> - * has been registered successfully by superseding a <tt>unknownOwnerId</tt>, - * that is an owner that does not exist anymore in the current project. + * Called if the <tt>targetFilename</tt> for the specified <tt>ownerId</tt> has been registered successfully by + * superseding a <tt>unknownOwnerId</tt>, that is an owner that does not exist anymore in the current project. * <p/> - * This means that the <tt>targetFilename</tt> was known but for an owner that - * does not exist anymore. Hence the file has been registered successfully to - * the new owner. + * This means that the <tt>targetFilename</tt> was known but for an owner that does not exist anymore. Hence the + * file has been registered successfully to the new owner. * - * @param ownerId the ownerId + * @param ownerId the ownerId * @param targetFilename the relative path according to the root of the webapp * @param unknownOwnerId the previous owner that does not exist anymore * @throws IOException if an error occurred while handling this event @@ -609,7 +587,7 @@ public class WebappStructure /** * Called if the version of the dependency has changed since the last build. * - * @param dependency the dependency + * @param dependency the dependency * @param previousVersion the previous version of the dependency */ void updatedVersion( Dependency dependency, String previousVersion ); @@ -617,16 +595,15 @@ public class WebappStructure /** * Called if the scope of the dependency has changed since the last build. * - * @param dependency the dependency + * @param dependency the dependency * @param previousScope the previous scope */ void updatedScope( Dependency dependency, String previousScope ); /** - * Called if the optional flag of the dependency has changed since the - * last build. + * Called if the optional flag of the dependency has changed since the last build. * - * @param dependency the dependency + * @param dependency the dependency * @param previousOptional the previous optional flag */ void updatedOptionalFlag( Dependency dependency, boolean previousOptional ); @@ -634,7 +611,7 @@ public class WebappStructure /** * Called if the dependency has been updated for unknown reason. * - * @param dependency the dependency + * @param dependency the dependency * @param previousDep the previous dependency */ void updatedUnknown( Dependency dependency, Dependency previousDep ); Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructureSerializer.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructureSerializer.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructureSerializer.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructureSerializer.java Wed Oct 1 22:03:26 2014 @@ -40,16 +40,16 @@ import java.io.Writer; public class WebappStructureSerializer { - private static final XStream xStream; + private static final XStream xstream; static { - xStream = new XStream( new DomDriver() ); + xstream = new XStream( new DomDriver() ); // Register aliases - xStream.alias( "webapp-structure", WebappStructure.class ); - xStream.alias( "path-set", PathSet.class ); - xStream.alias( "dependency", Dependency.class ); + xstream.alias( "webapp-structure", WebappStructure.class ); + xstream.alias( "path-set", PathSet.class ); + xstream.alias( "dependency", Dependency.class ); } @@ -60,7 +60,6 @@ public class WebappStructureSerializer { } - /** * Reads the {@link WebappStructure} from the specified file. * @@ -76,7 +75,7 @@ public class WebappStructureSerializer try { reader = ReaderFactory.newXmlReader( file ); - return (WebappStructure) xStream.fromXML( reader ); + return (WebappStructure) xstream.fromXML( reader ); } finally { @@ -88,7 +87,7 @@ public class WebappStructureSerializer * Saves the {@link WebappStructure} to the specified file. * * @param webappStructure the structure to save - * @param targetFile the file to use to save the structure + * @param targetFile the file to use to save the structure * @throws IOException if an error occurred while saving the webapp structure */ public void toXml( WebappStructure webappStructure, File targetFile ) @@ -99,8 +98,7 @@ public class WebappStructureSerializer { if ( !targetFile.getParentFile().exists() && !targetFile.getParentFile().mkdirs() ) { - throw new IOException( - "Could not create parent [" + targetFile.getParentFile().getAbsolutePath() + "]" ); + throw new IOException( "Could not create parent [" + targetFile.getParentFile().getAbsolutePath() + "]" ); } if ( !targetFile.exists() && !targetFile.createNewFile() ) @@ -108,7 +106,7 @@ public class WebappStructureSerializer throw new IOException( "Could not create file [" + targetFile.getAbsolutePath() + "]" ); } writer = WriterFactory.newXmlWriter( targetFile ); - xStream.toXML( webappStructure, writer ); + xstream.toXML( webappStructure, writer ); } finally { Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarExplodedMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarExplodedMojoTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarExplodedMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarExplodedMojoTest.java Wed Oct 1 22:03:26 2014 @@ -48,7 +48,6 @@ public abstract class AbstractWarExplode mojo = (WarExplodedMojo) lookupMojo( "exploded", getPomFile() ); } - /** * Returns the pom configuration to use. * @@ -66,12 +65,11 @@ public abstract class AbstractWarExplode /** * Configures the exploded mojo for the specified test. * <p/> - * If the <tt>sourceFiles</tt> parameter is <tt>null</tt>, sample - * JSPs are created by default. + * If the <tt>sourceFiles</tt> parameter is <tt>null</tt>, sample JSPs are created by default. * - * @param testId the id of the test + * @param testId the id of the test * @param artifactStubs the dependencies (may be null) - * @param sourceFiles the source files to create (may be null) + * @param sourceFiles the source files to create (may be null) * @return the webapp directory * @throws Exception if an error occurs while configuring the mojo */ @@ -90,9 +88,10 @@ public abstract class AbstractWarExplode else { webAppSource = createWebAppSource( testId, false ); - for (String sourceFile : sourceFiles) { - File sample = new File(webAppSource, sourceFile); - createFile(sample); + for ( String sourceFile : sourceFiles ) + { + File sample = new File( webAppSource, sourceFile ); + createFile( sample ); } @@ -104,8 +103,9 @@ public abstract class AbstractWarExplode if ( artifactStubs != null ) { - for (ArtifactStub artifactStub : artifactStubs) { - project.addArtifact(artifactStub); + for ( ArtifactStub artifactStub : artifactStubs ) + { + project.addArtifact( artifactStub ); } } @@ -115,11 +115,10 @@ public abstract class AbstractWarExplode return webAppDirectory; } - /** * Configures the exploded mojo for the specified test. * - * @param testId the id of the test + * @param testId the id of the test * @param artifactStubs the dependencies (may be null) * @return the webapp directory * @throws Exception if an error occurs while configuring the mojo @@ -146,8 +145,7 @@ public abstract class AbstractWarExplode } /** - * Asserts the default content of the war based on the specified - * webapp directory. + * Asserts the default content of the war based on the specified webapp directory. * * @param webAppDirectory the webapp directory * @return a list of File objects that have been asserted @@ -168,10 +166,8 @@ public abstract class AbstractWarExplode return content; } - /** - * Asserts the web.xml file of the war based on the specified - * webapp directory. + * Asserts the web.xml file of the war based on the specified webapp directory. * * @param webAppDirectory the webapp directory * @return a list with the web.xml File object @@ -188,25 +184,28 @@ public abstract class AbstractWarExplode } /** - * Asserts custom content of the war based on the specified webapp - * directory. + * Asserts custom content of the war based on the specified webapp directory. * * @param webAppDirectory the webapp directory - * @param filePaths an array of file paths relative to the webapp directory - * @param customMessage a custom message if an assertion fails + * @param filePaths an array of file paths relative to the webapp directory + * @param customMessage a custom message if an assertion fails * @return a list of File objects that have been inspected */ protected List<File> assertCustomContent( File webAppDirectory, String[] filePaths, String customMessage ) { final List<File> content = new ArrayList<File>(); - for (String filePath : filePaths) { - final File expectedFile = new File(webAppDirectory, filePath); - if (customMessage != null) { - assertTrue(customMessage + " - " + expectedFile.toString(), expectedFile.exists()); - } else { - assertTrue("source file not found: " + expectedFile.toString(), expectedFile.exists()); + for ( String filePath : filePaths ) + { + final File expectedFile = new File( webAppDirectory, filePath ); + if ( customMessage != null ) + { + assertTrue( customMessage + " - " + expectedFile.toString(), expectedFile.exists() ); } - content.add(expectedFile); + else + { + assertTrue( "source file not found: " + expectedFile.toString(), expectedFile.exists() ); + } + content.add( expectedFile ); } return content; } @@ -215,8 +214,8 @@ public abstract class AbstractWarExplode * Asserts that the webapp contains only the specified files. * * @param webAppDirectory the webapp directory - * @param expectedFiles the expected files - * @param filter an optional filter to ignore some resources + * @param expectedFiles the expected files + * @param filter an optional filter to ignore some resources */ protected void assertWebAppContent( File webAppDirectory, List<File> expectedFiles, FileFilter filter ) { @@ -233,34 +232,36 @@ public abstract class AbstractWarExplode // Now we have the files, sort them. Collections.sort( expectedFiles ); Collections.sort( webAppContent ); - assertEquals( "Invalid webapp content, expected " + expectedFiles.size() + "file(s) " + expectedFiles + - " but got " + webAppContent.size() + " file(s) " + webAppContent, expectedFiles, webAppContent ); + assertEquals( "Invalid webapp content, expected " + expectedFiles.size() + "file(s) " + expectedFiles + + " but got " + webAppContent.size() + " file(s) " + webAppContent, expectedFiles, webAppContent ); } /** * Builds the list of files and directories from the specified dir. * <p/> - * Note that the filter is not used the usual way. If the filter does - * not accept the current file, it's not added but yet the subdirectories - * are added if any. + * Note that the filter is not used the usual way. If the filter does not accept the current file, it's not added + * but yet the subdirectories are added if any. * - * @param dir the base directory - * @param filter the filter + * @param dir the base directory + * @param filter the filter * @param content the current content, updated recursivly */ private void buildFilesList( final File dir, FileFilter filter, final List<File> content ) { final File[] files = dir.listFiles(); - for (File file : files) { + for ( File file : files ) + { // Add the file if the filter is ok with it - if (filter.accept(file)) { - content.add(file); + if ( filter.accept( file ) ) + { + content.add( file ); } // Even if the file is not accepted and is a directory, add it - if (file.isDirectory()) { - buildFilesList(file, filter, content); + if ( file.isDirectory() ) + { + buildFilesList( file, filter, content ); } } @@ -274,7 +275,6 @@ public abstract class AbstractWarExplode private final int webAppDirIndex; - public FileFilterImpl( File webAppDirectory, String[] rejectedFilePaths ) { if ( rejectedFilePaths != null ) Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java Wed Oct 1 22:03:26 2014 @@ -66,7 +66,8 @@ public abstract class AbstractWarMojoTes setVariableValueToObject( mojo, "useCache", Boolean.FALSE ); setVariableValueToObject( mojo, "mavenFileFilter", lookup( MavenFileFilter.class.getName() ) ); setVariableValueToObject( mojo, "useJvmChmod", Boolean.TRUE ); - MavenSession mavenSession = new MavenSession( null, null, null, null, null, null, null, System.getProperties(), null ); + MavenSession mavenSession = + new MavenSession( null, null, null, null, null, null, null, System.getProperties(), null ); setVariableValueToObject( mojo, "session", mavenSession ); mojo.setClassesDirectory( classesDir ); mojo.setWarSourceDirectory( webAppSource ); @@ -92,9 +93,10 @@ public abstract class AbstractWarMojoTes if ( xmlFiles != null ) { - for (String o : xmlFiles) { - XMLFile = new File(xmlConfigDir, o); - createFile(XMLFile); + for ( String o : xmlFiles ) + { + XMLFile = new File( xmlConfigDir, o ); + createFile( XMLFile ); } } @@ -142,7 +144,6 @@ public abstract class AbstractWarMojoTes return createWebAppSource( id, true ); } - /** * create a class directory with or without a sample class * @@ -247,12 +248,14 @@ public abstract class AbstractWarMojoTes // Archive was not yet created for that id so let's create it final File rootDir = new File( OVERLAYS_ROOT_DIR, id ); rootDir.mkdirs(); - String[] filePaths = new String[]{"jsp/d/a.jsp", "jsp/d/b.jsp", "jsp/d/c.jsp", "jsp/a.jsp", "jsp/b.jsp", - "jsp/c.jsp", "WEB-INF/classes/a.class", "WEB-INF/classes/b.class", "WEB-INF/classes/c.class", - "WEB-INF/lib/a.jar", "WEB-INF/lib/b.jar", "WEB-INF/lib/c.jar", "WEB-INF/web.xml"}; + String[] filePaths = + new String[] { "jsp/d/a.jsp", "jsp/d/b.jsp", "jsp/d/c.jsp", "jsp/a.jsp", "jsp/b.jsp", "jsp/c.jsp", + "WEB-INF/classes/a.class", "WEB-INF/classes/b.class", "WEB-INF/classes/c.class", "WEB-INF/lib/a.jar", + "WEB-INF/lib/b.jar", "WEB-INF/lib/c.jar", "WEB-INF/web.xml" }; - for (String filePath : filePaths) { - createFile(new File(rootDir, filePath), id + "-" + filePath); + for ( String filePath : filePaths ) + { + createFile( new File( rootDir, filePath ), id + "-" + filePath ); } createArchive( rootDir, destFile ); @@ -261,7 +264,6 @@ public abstract class AbstractWarMojoTes // Overlay utilities - /** * Builds a test overlay. * @@ -296,7 +298,7 @@ public abstract class AbstractWarMojoTes { try { - //WarArchiver archiver = new WarArchiver(); + // WarArchiver archiver = new WarArchiver(); Archiver archiver = new JarArchiver(); @@ -305,7 +307,7 @@ public abstract class AbstractWarMojoTes archiver.setDestFile( destinationFile ); archiver.addDirectory( directory ); - //archiver.setWebxml( new File(directory, "WEB-INF/web.xml")); + // archiver.setWebxml( new File(directory, "WEB-INF/web.xml")); // create archive archiver.createArchive(); @@ -323,5 +325,4 @@ public abstract class AbstractWarMojoTes } } - } \ No newline at end of file Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarDependenciesAnalysisTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarDependenciesAnalysisTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarDependenciesAnalysisTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarDependenciesAnalysisTest.java Wed Oct 1 22:03:26 2014 @@ -30,8 +30,6 @@ import java.util.ArrayList; import java.util.List; /** - * - * * @author Stephane Nicoll */ public class WarDependenciesAnalysisTest @@ -47,7 +45,6 @@ public class WarDependenciesAnalysisTest return new File( getBasedir(), "target/test-classes/unit/dependenciesanalysis/test-dir" ); } - public void testNoChange() throws Exception { @@ -58,9 +55,10 @@ public class WarDependenciesAnalysisTest jarArtifact.setArtifactId( "lib-test" ); jarArtifact.setVersion( "1.0" ); - doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[]{jarArtifact}, new ArtifactStub[]{jarArtifact}, - new String[]{"WEB-INF/lib/lib-test-1.0.jar"}, - new String[]{"WEB-INF/lib/lib-test-1.0.jar"} ); + doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[] { jarArtifact }, + new ArtifactStub[] { jarArtifact }, + new String[] { "WEB-INF/lib/lib-test-1.0.jar" }, + new String[] { "WEB-INF/lib/lib-test-1.0.jar" } ); } @@ -74,8 +72,8 @@ public class WarDependenciesAnalysisTest jarArtifact.setArtifactId( "lib-test" ); jarArtifact.setVersion( "1.0" ); - doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[]{jarArtifact}, null, - new String[]{"WEB-INF/lib/lib-test-1.0.jar"}, null ); + doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[] { jarArtifact }, null, + new String[] { "WEB-INF/lib/lib-test-1.0.jar" }, null ); } @@ -93,9 +91,10 @@ public class WarDependenciesAnalysisTest jarArtifact2.setArtifactId( "lib-test" ); jarArtifact2.setVersion( "2.0" ); - doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[]{jarArtifact}, new ArtifactStub[]{jarArtifact2}, - new String[]{"WEB-INF/lib/lib-test-1.0.jar"}, - new String[]{"WEB-INF/lib/lib-test-2.0.jar"} ); + doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[] { jarArtifact }, + new ArtifactStub[] { jarArtifact2 }, + new String[] { "WEB-INF/lib/lib-test-1.0.jar" }, + new String[] { "WEB-INF/lib/lib-test-2.0.jar" } ); } @@ -114,8 +113,9 @@ public class WarDependenciesAnalysisTest jarArtifact2.setVersion( "1.0" ); jarArtifact2.setScope( Artifact.SCOPE_PROVIDED ); - doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[]{jarArtifact}, new ArtifactStub[]{jarArtifact2}, - new String[]{"WEB-INF/lib/lib-test-1.0.jar"}, null ); + doTestTwiceWithUpdatedDependency( testId, new ArtifactStub[] { jarArtifact }, + new ArtifactStub[] { jarArtifact2 }, + new String[] { "WEB-INF/lib/lib-test-1.0.jar" }, null ); } @@ -125,7 +125,7 @@ public class WarDependenciesAnalysisTest throws Exception { // setup test data - final File xmlSource = createXMLConfigDir( testId, new String[]{"web.xml"} ); + final File xmlSource = createXMLConfigDir( testId, new String[] { "web.xml" } ); final File webAppDirectory = setUpMojoWithCache( testId, firstStubs ); try { @@ -138,7 +138,7 @@ public class WarDependenciesAnalysisTest assertedFiles.addAll( assertCustomContent( webAppDirectory, firstCustomContent, "library not found" ) ); // Ok now check that there is no more files/directories - final FileFilter filter = new FileFilterImpl( webAppDirectory, new String[]{MANIFEST_PATH} ); + final FileFilter filter = new FileFilterImpl( webAppDirectory, new String[] { MANIFEST_PATH } ); assertWebAppContent( webAppDirectory, assertedFiles, filter ); // Run the thing again and check it's ok @@ -151,8 +151,7 @@ public class WarDependenciesAnalysisTest assertedFiles2.addAll( assertWebXml( webAppDirectory ) ); if ( secondCustomContent != null ) { - assertedFiles2.addAll( - assertCustomContent( webAppDirectory, secondCustomContent, "library not found" ) ); + assertedFiles2.addAll( assertCustomContent( webAppDirectory, secondCustomContent, "library not found" ) ); } assertWebAppContent( webAppDirectory, assertedFiles2, filter ); @@ -169,7 +168,7 @@ public class WarDependenciesAnalysisTest /** * Configures the exploded mojo for the specified test. * - * @param testId the id of the test + * @param testId the id of the test * @param artifactStubs the dependencies (may be null) * @return the webapp directory * @throws Exception if an error occurs while configuring the mojo @@ -185,5 +184,4 @@ public class WarDependenciesAnalysisTest return webappDir; } - } Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java Wed Oct 1 22:03:26 2014 @@ -47,7 +47,6 @@ public class WarExplodedMojoFilteringTes { return new File( getBasedir(), "target/test-classes/unit/warexplodedmojo/test-dir" ); } - /** * @throws Exception @@ -65,7 +64,7 @@ public class WarExplodedMojoFilteringTes File sampleResource = new File( webAppResource, "custom-setting.cfg" ); File sampleResourceWDir = new File( webAppResource, "custom-config/custom-setting.cfg" ); List<String> filterList = new LinkedList<String>(); - ResourceStub[] resources = new ResourceStub[]{new ResourceStub()}; + ResourceStub[] resources = new ResourceStub[] { new ResourceStub() }; createFile( sampleResource ); createFile( sampleResourceWDir ); @@ -119,7 +118,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_key_1=" + System.getProperty( "user.dir" ), line ); line = reader.readLine(); - System.out.println(" line " + line ); + System.out.println( " line " + line ); assertEquals( "error in filtering using System properties", "system_key_2=" + System.getProperty( "user.dir" ), line ); @@ -132,7 +131,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_property_1=system-property-value", reader.readLine() ); assertEquals( "error in filtering using System properties", "system_property_2=system-property-value", - reader.readLine() ); + reader.readLine() ); // update property, and generate again System.setProperty( "system.property", "new-system-property-value" ); @@ -148,7 +147,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_key_1=" + System.getProperty( "user.dir" ), reader.readLine() ); assertEquals( "error in filtering using System properties", "system_key_2=" + System.getProperty( "user.dir" ), - reader.readLine() ); + reader.readLine() ); assertEquals( "error in filtering using project properties", "project_key_1=i_think_so", reader.readLine() ); assertEquals( "error in filtering using project properties", "project_key_2=i_think_so", reader.readLine() ); @@ -159,7 +158,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_property_1=new-system-property-value", reader.readLine() ); assertEquals( "error in filtering using System properties", "system_property_2=new-system-property-value", - reader.readLine() ); + reader.readLine() ); // update property, and generate again File filterFile = new File( getTestDirectory(), testId + "-test-data/filters/filter.properties" ); @@ -184,7 +183,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_key_1=" + System.getProperty( "user.dir" ), reader.readLine() ); assertEquals( "error in filtering using System properties", "system_key_2=" + System.getProperty( "user.dir" ), - reader.readLine() ); + reader.readLine() ); assertEquals( "error in filtering using project properties", "project_key_1=i_think_so", reader.readLine() ); assertEquals( "error in filtering using project properties", "project_key_2=i_think_so", reader.readLine() ); @@ -195,7 +194,7 @@ public class WarExplodedMojoFilteringTes assertEquals( "error in filtering using System properties", "system_property_1=new-system-property-value", reader.readLine() ); assertEquals( "error in filtering using System properties", "system_property_2=new-system-property-value", - reader.readLine() ); + reader.readLine() ); assertEquals( "error in filtering using filter files", "resource_key_1=this_is_filtered", reader.readLine() ); assertEquals( "error in filtering using filter files", "resource_key_2=this_is_filtered", reader.readLine() ); @@ -205,6 +204,6 @@ public class WarExplodedMojoFilteringTes expectedWebSource2File.delete(); expectedResourceFile.delete(); expectedResourceWDirFile.delete(); - } + } } Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java Wed Oct 1 22:03:26 2014 @@ -70,7 +70,7 @@ public class WarExplodedMojoTest File webAppResource = new File( getTestDirectory(), testId + "-resources" ); File webAppDirectory = new File( getTestDirectory(), testId ); File sampleResource = new File( webAppResource, "pix/panis_na.jpg" ); - ResourceStub[] resources = new ResourceStub[]{new ResourceStub()}; + ResourceStub[] resources = new ResourceStub[] { new ResourceStub() }; createFile( sampleResource ); @@ -115,7 +115,7 @@ public class WarExplodedMojoTest File webAppResource = new File( getTestDirectory(), "resources" ); File webAppDirectory = new File( getTestDirectory(), testId ); File sampleResource = new File( webAppResource, "pix/panis_na.jpg" ); - ResourceStub[] resources = new ResourceStub[]{new ResourceStub()}; + ResourceStub[] resources = new ResourceStub[] { new ResourceStub() }; createFile( sampleResource ); @@ -156,7 +156,7 @@ public class WarExplodedMojoTest MavenProjectBasicStub project = new MavenProjectBasicStub(); File webAppSource = createWebAppSource( testId ); File classesDir = createClassesDir( testId, true ); - File xmlSource = createXMLConfigDir( testId, new String[]{"web.xml"} ); + File xmlSource = createXMLConfigDir( testId, new String[] { "web.xml" } ); File webAppDirectory = new File( getTestDirectory(), testId ); // configure mojo @@ -194,7 +194,7 @@ public class WarExplodedMojoTest MavenProjectBasicStub project = new MavenProjectBasicStub(); File classesDir = createClassesDir( testId, true ); File webAppSource = createWebAppSource( testId ); - File xmlSource = createXMLConfigDir( testId, new String[]{"config.xml"} ); + File xmlSource = createXMLConfigDir( testId, new String[] { "config.xml" } ); File webAppDirectory = new File( getTestDirectory(), testId ); // configure mojo @@ -317,60 +317,60 @@ public class WarExplodedMojoTest expectedFile.delete(); } -// The last modified thingy behavior is not applicable anymore. This is the only test that -// has been removed. -// /** -// * Merge a dependent WAR that gets updated since the last run. -// */ -// public void testExplodedWarMergeWarUpdated() -// throws Exception -// { -// // setup test data -// MavenProjectArtifactsStub project = new MavenProjectArtifactsStub(); -// WarArtifactStub warArtifact = new WarArtifactStub( getBasedir() ); -// -// String testId = "testExplodedWarMergeWarUpdated"; -// File webAppDirectory = new File( getTestDirectory(), testId ); -// FileUtils.deleteDirectory( webAppDirectory ); -// -// File webAppSource = getWebAppSource( testId ); -// -// File workDirectory = new File( getTestDirectory(), "/war/work-" + testId ); -// createDir( workDirectory ); -// -// File classesDir = createClassesDir( testId, true ); -// -// // configure mojo -// project.addArtifact( warArtifact ); -// this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project ); -// setVariableValueToObject( mojo, "workDirectory", workDirectory ); -// mojo.execute(); -// -// // validate operation -// File expectedFile = new File( webAppDirectory, "/org/sample/company/test.jsp" ); -// -// assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); -// assertEquals( "file incorrect", "", FileUtils.fileRead( expectedFile ) ); -// -// // update file, so the local one is older -// warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple-updated.war" ) ); -// -// mojo.execute(); -// -// assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); -// assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) ); -// -// // update file, so the local one is newer -// warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple.war" ) ); -// -// mojo.execute(); -// -// assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); -// assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) ); -// -// // house keeping -// expectedFile.delete(); -// } + // The last modified thingy behavior is not applicable anymore. This is the only test that + // has been removed. + // /** + // * Merge a dependent WAR that gets updated since the last run. + // */ + // public void testExplodedWarMergeWarUpdated() + // throws Exception + // { + // // setup test data + // MavenProjectArtifactsStub project = new MavenProjectArtifactsStub(); + // WarArtifactStub warArtifact = new WarArtifactStub( getBasedir() ); + // + // String testId = "testExplodedWarMergeWarUpdated"; + // File webAppDirectory = new File( getTestDirectory(), testId ); + // FileUtils.deleteDirectory( webAppDirectory ); + // + // File webAppSource = getWebAppSource( testId ); + // + // File workDirectory = new File( getTestDirectory(), "/war/work-" + testId ); + // createDir( workDirectory ); + // + // File classesDir = createClassesDir( testId, true ); + // + // // configure mojo + // project.addArtifact( warArtifact ); + // this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project ); + // setVariableValueToObject( mojo, "workDirectory", workDirectory ); + // mojo.execute(); + // + // // validate operation + // File expectedFile = new File( webAppDirectory, "/org/sample/company/test.jsp" ); + // + // assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); + // assertEquals( "file incorrect", "", FileUtils.fileRead( expectedFile ) ); + // + // // update file, so the local one is older + // warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple-updated.war" ) ); + // + // mojo.execute(); + // + // assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); + // assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) ); + // + // // update file, so the local one is newer + // warArtifact.setFile( new File( warArtifact.getFile().getParentFile(), "simple.war" ) ); + // + // mojo.execute(); + // + // assertTrue( "file not found: " + expectedFile.toString(), expectedFile.exists() ); + // assertEquals( "file incorrect", "updated\n", FileUtils.fileRead( expectedFile ) ); + // + // // house keeping + // expectedFile.delete(); + // } /** * @throws Exception @@ -709,8 +709,7 @@ public class WarExplodedMojoTest assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() ); assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() ); assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() ); - assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), - expectedEJBDupArtifact.exists() ); + assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), expectedEJBDupArtifact.exists() ); // house keeping expectedWebSourceFile.delete(); @@ -762,8 +761,7 @@ public class WarExplodedMojoTest assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() ); assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() ); assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() ); - assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), - expectedEJBDupArtifact.exists() ); + assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), expectedEJBDupArtifact.exists() ); // house keeping expectedWebSourceFile.delete(); @@ -1017,8 +1015,7 @@ public class WarExplodedMojoTest assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() ); assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() ); assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() ); - assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), - expectedEJBDupArtifact.exists() ); + assertTrue( "ejb dup artifact not found: " + expectedEJBDupArtifact.toString(), expectedEJBDupArtifact.exists() ); // house keeping expectedWebSourceFile.delete(); @@ -1031,5 +1028,4 @@ public class WarExplodedMojoTest /*---------------------------*/ - } Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarInPlaceMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarInPlaceMojoTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarInPlaceMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarInPlaceMojoTest.java Wed Oct 1 22:03:26 2014 @@ -28,8 +28,8 @@ import java.util.LinkedList; public class WarInPlaceMojoTest extends AbstractWarMojoTest { - protected static final String pomFilePath = - getBasedir() + "/target/test-classes/unit/warexplodedinplacemojo/plugin-config.xml"; + protected static final String pomFilePath = getBasedir() + + "/target/test-classes/unit/warexplodedinplacemojo/plugin-config.xml"; protected File getTestDirectory() throws Exception @@ -67,7 +67,7 @@ public class WarInPlaceMojoTest File classesDir = createClassesDir( testId, true ); File webAppResource = new File( getTestDirectory(), "resources" ); File sampleResource = new File( webAppResource, "pix/panis_na.jpg" ); - ResourceStub[] resources = new ResourceStub[]{new ResourceStub()}; + ResourceStub[] resources = new ResourceStub[] { new ResourceStub() }; createFile( sampleResource ); Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java?rev=1628849&r1=1628848&r2=1628849&view=diff ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarManifestMojoTest.java Wed Oct 1 22:03:26 2014 @@ -140,11 +140,11 @@ public class WarManifestMojoTest idx = content.indexOf( "Implementation-Vendor" ); - assertTrue( idx >= 0 ); + assertTrue( idx >= 0 ); } public void testManifestWithCustomAttributes() - throws Exception + throws Exception { loadMojo( "target/test-classes/unit/manifest/manifest-with-custom-attrs/plugin-config.xml" ); @@ -167,11 +167,10 @@ public class WarManifestMojoTest int idx = content.indexOf( "Specification-Title" ); assertTrue( idx >= 0 ); - - idx = content.indexOf( "Custom-Version" ); - assertTrue( idx >= 0); + idx = content.indexOf( "Custom-Version" ); + assertTrue( idx >= 0 ); }