Merge pull request #9 from javawerks/bug-NETBEANSINFRA-187

NETBEANSINFRA-187 Bug netbeansinfra 187
diff --git a/pom.xml b/pom.xml
index c149649..6ef2230 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,8 +54,8 @@
         <connection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nbm-maven-plugin.git</connection>
         <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-mavenutils-nbm-maven-plugin.git</developerConnection>
         <url>https://github.com/apache/netbeans-mavenutils-nbm-maven-plugin</url>
-      <tag>HEAD</tag>
-  </scm>
+        <tag>HEAD</tag>
+    </scm>
     <build>
         <plugins>
             <plugin>
@@ -177,7 +177,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-changes-plugin</artifactId>
                 <version>2.12.1</version>
-                 <configuration>
+                <configuration>
                     <component>12336702</component>
                 </configuration>
    
diff --git a/src/it/full/application/src/test/java/nbmmavenpluginit/ittest/ApplicationTest.java b/src/it/full/application/src/test/java/nbmmavenpluginit/ittest/ApplicationTest.java
index 61270ce..2b12a70 100644
--- a/src/it/full/application/src/test/java/nbmmavenpluginit/ittest/ApplicationTest.java
+++ b/src/it/full/application/src/test/java/nbmmavenpluginit/ittest/ApplicationTest.java
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package nbmmavenpluginit.ittest;
 
 import java.util.logging.Level;
@@ -24,23 +23,27 @@
 import org.netbeans.junit.NbModuleSuite;
 import org.netbeans.junit.NbTestCase;
 
-public class ApplicationTest extends NbTestCase {
+public class ApplicationTest extends NbTestCase
+{
 
-    public static Test suite() {
-        return NbModuleSuite.createConfiguration(ApplicationTest.class).
-                gui(false).
-                failOnMessage(Level.WARNING). // works at least in RELEASE71
-                failOnException(Level.INFO).
-                enableClasspathModules(false). 
-                clusters(".*").
+    public static Test suite()
+    {
+        return NbModuleSuite.createConfiguration( ApplicationTest.class ).
+                gui( false ).
+                failOnMessage( Level.WARNING ). // works at least in RELEASE71
+                failOnException( Level.INFO ).
+                enableClasspathModules( false ).
+                clusters( ".*" ).
                 suite(); // RELEASE71+, else use NbModuleSuite.create(NbModuleSuite.createConfiguration(...))
     }
 
-    public ApplicationTest(String n) {
-        super(n);
+    public ApplicationTest( String n )
+    {
+        super( n );
     }
 
-    public void testApplication() {
+    public void testApplication()
+    {
         // pass if there are merely no warnings/exceptions
         /* Example of using Jelly Tools (additional test dependencies required) with gui(true):
         new ActionNoBlock("Help|About", null).performMenu();
diff --git a/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java b/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
index c106fb1..afd82e9 100644
--- a/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
@@ -48,15 +48,14 @@
 import org.apache.netbeans.nbm.utils.ExamineManifest;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
-
 import org.codehaus.plexus.util.IOUtil;
 
 public abstract class AbstractNbmMojo
-    extends AbstractNetbeansMojo
+        extends AbstractNetbeansMojo
 {
 
     static boolean matchesLibrary( Artifact artifact, List<String> libraries, ExamineManifest depExaminator,
-        Log log, boolean useOsgiDependencies )
+                                   Log log, boolean useOsgiDependencies )
     {
         String artId = artifact.getArtifactId();
         String grId = artifact.getGroupId();
@@ -65,14 +64,14 @@
         if ( explicit )
         {
             log.debug(
-                id + " included as module library, explicitly declared in module descriptor." );
+                    id + " included as module library, explicitly declared in module descriptor." );
             return explicit;
         }
         if ( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) || Artifact.SCOPE_SYSTEM.equals(
-            artifact.getScope() ) )
+                artifact.getScope() ) )
         {
             log.debug(
-                id + " omitted as module library, has scope 'provided/system'" );
+                    id + " omitted as module library, has scope 'provided/system'" );
             return false;
         }
         if ( "nbm".equals( artifact.getType() ) )
@@ -86,12 +85,12 @@
             return false;
         }
         log.debug(
-            id + " included as module library, squeezed through all the filters." );
+                id + " included as module library, squeezed through all the filters." );
         return true;
     }
 
     static Dependency resolveNetBeansDependency( Artifact artifact, List<Dependency> deps,
-        ExamineManifest manifest, Log log )
+                                                 ExamineManifest manifest, Log log )
     {
         String artId = artifact.getArtifactId();
         String grId = artifact.getGroupId();
@@ -111,7 +110,7 @@
                         return dep;
                     }
                     log.warn(
-                        id + " declared as module dependency in descriptor, but not a NetBeans module" );
+                            id + " declared as module dependency in descriptor, but not a NetBeans module" );
                     return null;
                 }
             }
@@ -136,17 +135,17 @@
     }
 
     protected final NetBeansModule readModuleDescriptor( File descriptor )
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         if ( descriptor == null )
         {
             throw new MojoExecutionException(
-                "The module descriptor has to be configured." );
+                    "The module descriptor has to be configured." );
         }
         if ( !descriptor.exists() )
         {
             throw new MojoExecutionException(
-                "The module descriptor is missing: '" + descriptor + "'." );
+                    "The module descriptor is missing: '" + descriptor + "'." );
         }
         Reader r = null;
         try
@@ -159,14 +158,14 @@
         catch ( IOException exc )
         {
             throw new MojoExecutionException(
-                "Error while reading module descriptor '" + descriptor + "'.",
-                exc );
+                    "Error while reading module descriptor '" + descriptor + "'.",
+                    exc );
         }
         catch ( XmlPullParserException xml )
         {
             throw new MojoExecutionException(
-                "Error while reading module descriptor '" + descriptor + "'.",
-                xml );
+                    "Error while reading module descriptor '" + descriptor + "'.",
+                    xml );
         }
         finally
         {
@@ -180,7 +179,7 @@
         if ( log )
         {
             getLog().info(
-                "No Module Descriptor defined, trying to fallback to generated values:" );
+                    "No Module Descriptor defined, trying to fallback to generated values:" );
         }
         NetBeansModule module = new NetBeansModule();
         return module;
@@ -190,7 +189,7 @@
                                                List<Artifact> runtimeArtifacts,
                                                Map<Artifact, ExamineManifest> examinerCache, Log log,
                                                boolean useOsgiDependencies )
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         List<Artifact> include = new ArrayList<Artifact>();
         if ( module != null )
@@ -201,7 +200,8 @@
                 librList.addAll( module.getLibraries() );
             }
             CollectLibrariesNodeVisitor visitor = new CollectLibrariesNodeVisitor( librList,
-                runtimeArtifacts, examinerCache, log, treeRoot, useOsgiDependencies );
+                                                                                   runtimeArtifacts, examinerCache, log,
+                                                                                   treeRoot, useOsgiDependencies );
             treeRoot.accept( visitor );
             include.addAll( visitor.getArtifacts() );
         }
@@ -213,19 +213,21 @@
                                                              Map<Artifact, ExamineManifest> examinerCache,
                                                              List<Artifact> libraryArtifacts, Log log,
                                                              boolean useOsgiDependencies )
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         List<Dependency> deps = new ArrayList<Dependency>();
-        if ( customDependencies != null ) 
+        if ( customDependencies != null )
         {
             deps.addAll( Arrays.asList( customDependencies ) );
         }
         if ( module != null && !module.getDependencies().isEmpty() )
         {
-            log.warn( "dependencies in module descriptor are deprecated, use the plugin's parameter moduleDependencies" );
+            log.warn(
+                    "dependencies in module descriptor are deprecated, use the plugin's parameter moduleDependencies" );
+
             //we need to make sure a dependency is not twice there, module deps override the config (as is the case with other
             //configurations)
-            for ( Dependency d : module.getDependencies() ) 
+            for ( Dependency d : module.getDependencies() )
             {
                 Dependency found = null;
                 for ( Dependency d2 : deps )
@@ -244,86 +246,90 @@
             }
         }
         List<ModuleWrapper> include = new ArrayList<ModuleWrapper>();
-        
-            @SuppressWarnings( "unchecked" )
-            List<Artifact> artifacts = project.getCompileArtifacts();
-            for ( Artifact artifact : artifacts )
+
+        @SuppressWarnings( "unchecked" )
+        List<Artifact> artifacts = project.getCompileArtifacts();
+        for ( Artifact artifact : artifacts )
+        {
+            if ( libraryArtifacts.contains( artifact ) )
             {
-                if ( libraryArtifacts.contains( artifact ) )
+                continue;
+            }
+            ExamineManifest depExaminator = examinerCache.get( artifact );
+            if ( depExaminator == null )
+            {
+                depExaminator = new ExamineManifest( log );
+                depExaminator.setArtifactFile( artifact.getFile() );
+                depExaminator.checkFile();
+                examinerCache.put( artifact, depExaminator );
+            }
+            Dependency dep = resolveNetBeansDependency( artifact, deps, depExaminator, log );
+            if ( dep != null )
+            {
+                ModuleWrapper wr = new ModuleWrapper();
+                wr.dependency = dep;
+                wr.artifact = artifact;
+                wr.transitive = false;
+                //only direct deps matter to us..
+                if ( depExaminator.isNetBeansModule() && artifact.getDependencyTrail().size() > 2 )
                 {
-                    continue;
+                    log.debug(
+                            artifact.getId()
+                            + " omitted as NetBeans module dependency, not a direct one. "
+                            + "Declare it in the pom for inclusion." );
+                    wr.transitive = true;
+
                 }
-                ExamineManifest depExaminator = examinerCache.get( artifact );
-                if ( depExaminator == null )
-                {
-                    depExaminator = new ExamineManifest( log );
-                    depExaminator.setArtifactFile( artifact.getFile() );
-                    depExaminator.checkFile();
-                    examinerCache.put( artifact, depExaminator );
-                }
-                Dependency dep = resolveNetBeansDependency( artifact, deps, depExaminator, log );
-                if ( dep != null )
+                include.add( wr );
+            }
+            else
+            {
+                if ( useOsgiDependencies && depExaminator.isOsgiBundle() )
                 {
                     ModuleWrapper wr = new ModuleWrapper();
-                    wr.dependency = dep;
+                    wr.osgi = true;
+                    String id = artifact.getGroupId() + ":" + artifact.getArtifactId();
+                    for ( Dependency depe : deps )
+                    {
+                        if ( id.equals( depe.getId() ) )
+                        {
+                            wr.dependency = depe;
+                        }
+                    }
+                    boolean print = false;
+                    if ( wr.dependency == null )
+                    {
+                        Dependency depe = new Dependency();
+                        depe.setId( id );
+                        depe.setType( "spec" );
+                        wr.dependency = depe;
+                        print = true;
+                    }
+
                     wr.artifact = artifact;
                     wr.transitive = false;
                     //only direct deps matter to us..
-                    if ( depExaminator.isNetBeansModule() && artifact.getDependencyTrail().size() > 2 )
+                    if ( artifact.getDependencyTrail().size() > 2 )
                     {
                         log.debug(
-                            artifact.getId() + " omitted as NetBeans module dependency, not a direct one. Declare it in the pom for inclusion." );
+                                artifact.getId()
+                                + " omitted as NetBeans module OSGi dependency, not a direct one. "
+                                + "Declare it in the pom for inclusion." );
                         wr.transitive = true;
 
                     }
+                    else
+                    {
+                        if ( print )
+                        {
+                            log.info( "Adding OSGi bundle dependency - " + id );
+                        }
+                    }
+
                     include.add( wr );
                 }
-                else
-                {
-                    if ( useOsgiDependencies && depExaminator.isOsgiBundle() )
-                    {
-                        ModuleWrapper wr = new ModuleWrapper();
-                        wr.osgi = true;
-                        String id = artifact.getGroupId() + ":" + artifact.getArtifactId();
-                        for ( Dependency depe : deps )
-                        {
-                            if ( id.equals( depe.getId() ) )
-                            {
-                                wr.dependency = depe;
-                            }
-                        }
-                        boolean print = false;
-                        if ( wr.dependency == null )
-                        {
-                            Dependency depe = new Dependency();
-                            depe.setId( id );
-                            depe.setType( "spec" );
-                            wr.dependency = depe;
-                            print = true;
-                        }
-
-                        wr.artifact = artifact;
-                        wr.transitive = false;
-                        //only direct deps matter to us..
-                        if ( artifact.getDependencyTrail().size() > 2 )
-                        {
-                            log.debug(
-                                artifact.getId() + " omitted as NetBeans module OSGi dependency, not a direct one. Declare it in the pom for inclusion." );
-                            wr.transitive = true;
-
-                        }
-                        else
-                        {
-                            if ( print )
-                            {
-                                log.info( "Adding OSGi bundle dependency - " + id );
-                            }
-                        }
-
-                        include.add( wr );
-                    }
-                }
             }
+        }
         return include;
     }
 
@@ -335,7 +341,7 @@
         Artifact artifact;
 
         boolean transitive = true;
-        
+
         boolean osgi = false;
 
     }
@@ -343,7 +349,7 @@
     //copied from dependency:tree mojo
     protected DependencyNode createDependencyTree( MavenProject project, DependencyGraphBuilder dependencyGraphBuilder,
                                                    String scope )
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         ArtifactFilter artifactFilter = createResolvingArtifactFilter( scope );
         try
@@ -385,7 +391,7 @@
     protected final ArtifactResult turnJarToNbmFile( Artifact art, ArtifactFactory artifactFactory,
                                                      ArtifactResolver artifactResolver, MavenProject project,
                                                      ArtifactRepository localRepository )
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         if ( "jar".equals( art.getType() ) || "nbm".equals( art.getType() ) )
         {
@@ -403,7 +409,7 @@
                 String path = localRepository.pathOf( art );
                 File jar2 = new File( localRepository.getBasedir(), path.replace( "/", File.separator ) );
                 File manifest = new File( jar, "META-INF/MANIFEST.MF" );
-                
+
                 if ( !jar2.isFile() || !manifest.isFile() )
                 {
                     getLog().warn( "MNBMODULE-131: need to at least run install phase on " + jar2 );
@@ -419,12 +425,12 @@
             if ( mnf.isNetBeansModule() )
             {
                 Artifact nbmArt = artifactFactory.createDependencyArtifact(
-                    art.getGroupId(),
-                    art.getArtifactId(),
-                    art.getVersionRange(),
-                    "nbm-file",
-                    art.getClassifier(),
-                    art.getScope() );
+                        art.getGroupId(),
+                        art.getArtifactId(),
+                        art.getVersionRange(),
+                        "nbm-file",
+                        art.getClassifier(),
+                        art.getScope() );
                 try
                 {
                     artifactResolver.resolve( nbmArt, project.getRemoteArtifactRepositories(), localRepository );
@@ -460,6 +466,7 @@
 
     protected static final class ArtifactResult
     {
+
         private final Artifact converted;
         private final ExamineManifest manifest;
 
diff --git a/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java b/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
index f6bbe99..7e2d90e 100644
--- a/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
+++ b/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
@@ -25,7 +25,8 @@
 import java.util.TimeZone;
 
 /**
- *  will try to convert the maven version number to a NetBeans friendly version number.
+ * will try to convert the maven version number to a NetBeans friendly version number.
+ *
  * @author Milos Kleint
  *
  */
@@ -67,7 +68,7 @@
                 if ( token.indexOf( '-' ) > 0 )
                 {
                     token = token.substring( 0, token.indexOf( '-' ) );
-                } 
+                }
                 else if ( token.indexOf( '_' ) > 0 )
                 {
                     token = token.substring( 0, token.indexOf( '_' ) );
diff --git a/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java b/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java
index af01314..d92b25f 100644
--- a/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java
@@ -30,24 +30,24 @@
 import org.codehaus.plexus.util.FileUtils;
 
 /**
- * Package branding resources for NetBeans platform/IDE based application.
- * The format of branding resources is the same as in
- * NetBeans Ant-based projects.
- * 
- * The <code>src/main/nbm-branding</code> folder of the project is assumed to 
- * contain the branding content. Within the directory, the following folder structure is assumed:
+ * Package branding resources for NetBeans platform/IDE based application. The format of branding resources is the same
+ * as in NetBeans Ant-based projects.
+ *
+ * The <code>src/main/nbm-branding</code> folder of the project is assumed to contain the branding content. Within the
+ * directory, the following folder structure is assumed:
  * <ul>
  * <li>
  * 1. pick the IDE/platform module which contents you want to brand. eg. org-openide-windows.jar
  * </li><li>
- * 2. locate the jar within the IDE/platform installation and it's cluster, eg. modules/org-openide-windows.jar 
+ * 2. locate the jar within the IDE/platform installation and it's cluster, eg. modules/org-openide-windows.jar
  * </li><li>
- * 3. create the same folder structure in src/main/nbm-branding, make folder with the module's jar name as well.
- * eg. create folder by name modules/org-openide-windows.jar
+ * 3. create the same folder structure in src/main/nbm-branding, make folder with the module's jar name as well. eg.
+ * create folder by name modules/org-openide-windows.jar
  * </li><li>
- * 4. within that folder place your branding modifications at the same location, as if they were withn the jar,
- * eg. org/openide/windows/ui/Bundle.properties and place the changed bundle keys there.
+ * 4. within that folder place your branding modifications at the same location, as if they were withn the jar, eg.
+ * org/openide/windows/ui/Bundle.properties and place the changed bundle keys there.
  * </li></ul>
+ *
  * @author Milos Kleint
  *
  *
@@ -65,21 +65,21 @@
      */
     @Parameter( required = true, defaultValue = "${project.build.directory}/nbm" )
     protected File nbmBuildDir;
-    
+
     /**
-    * output directory.
-    */
+     * output directory.
+     */
     @Parameter( defaultValue = "${project.build.directory}", required = true )
     protected File outputDirectory;
-    
+
     /**
      * Location of the branded resources.
      */
     @Parameter( required = true, defaultValue = "${basedir}/src/main/nbm-branding" )
     private File brandingSources;
     /**
-     * The branding token used by the application.
-     * Required unless {@code nbmBuildDir} does not exist and the mojo is thus skipped.
+     * The branding token used by the application. Required unless {@code nbmBuildDir} does not exist and the mojo is
+     * thus skipped.
      */
     @Parameter( property = "netbeans.branding.token" )
     private String brandingToken;
@@ -97,11 +97,12 @@
     private MavenProject project;
 
     public void execute()
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
-        if ( !"nbm".equals( project.getPackaging() ) ) 
+        if ( !"nbm".equals( project.getPackaging() ) )
         {
-            getLog().error( "The nbm:branding goal shall be used within a NetBeans module project only (packaging 'nbm')" );
+            getLog().error(
+                    "The nbm:branding goal shall be used within a NetBeans module project only (packaging 'nbm')" );
         }
         if ( !brandingSources.isDirectory() )
         {
@@ -117,9 +118,9 @@
 
             DirectoryScanner scanner = new DirectoryScanner();
             scanner.setIncludes( new String[]
-                    {
-                        "**/*.*"
-                    } );
+            {
+                "**/*.*"
+            } );
             scanner.addDefaultExcludes();
             scanner.setBasedir( brandingSources );
             scanner.scan();
@@ -139,25 +140,26 @@
                 File root = new File( outputDir, token );
                 root.mkdirs();
                 String destinationName = locale[0] + "_" + token + locale[2];
-                File brandingDestination = new File( root, brandingFilePath.replace( brandingFile.getName(), destinationName ) );
+                File brandingDestination = new File( root, brandingFilePath.replace( brandingFile.getName(),
+                        destinationName ) );
                 if ( !brandingDestination.getParentFile().exists() )
                 {
                     brandingDestination.getParentFile().mkdirs();
                 }
                 FileUtils.copyFile( brandingFile, brandingDestination );
             }
-            for ( File rootDir : outputDir.listFiles() ) 
+            for ( File rootDir : outputDir.listFiles() )
             {
-                if ( !rootDir.isDirectory() ) 
+                if ( !rootDir.isDirectory() )
                 {
                     continue;
                 }
                 String effectiveBranding = rootDir.getName();
                 // create jar-files from each toplevel .jar directory
                 scanner.setIncludes( new String[]
-                    {
-                        "**/*.jar"
-                    } );
+                {
+                    "**/*.jar"
+                } );
                 scanner.setBasedir( rootDir );
                 scanner.scan();
                 for ( String jarDirectoryPath : scanner.getIncludedDirectories() )
@@ -167,9 +169,9 @@
                     File destinationLocation = new File( clusterDir, jarDirectoryPath ).getParentFile();
                     destinationLocation.mkdirs();
                     // jars should be placed in locales/ under the same directory the jar-directories are
-                    File destinationJar =
-                        new File( destinationLocation + File.separator + "locale"
-                            + File.separator + destinationFileName( jarDirectory.getName(), effectiveBranding ) );
+                    File destinationJar
+                            = new File( destinationLocation + File.separator + "locale"
+                                    + File.separator + destinationFileName( jarDirectory.getName(), effectiveBranding ) );
 
                     // create nnn.jar archive of contents
                     JarArchiver archiver = new JarArchiver();
@@ -186,7 +188,7 @@
         }
     }
 
-    static  String destinationFileName( String brandingFilePath, String branding )
+    static String destinationFileName( String brandingFilePath, String branding )
     {
         // use first underscore in filename 
         int lastSeparator = brandingFilePath.lastIndexOf( File.separator );
@@ -200,7 +202,7 @@
         }
         return brandingFilePath.substring( 0, lastDot ) + infix + brandingFilePath.substring( lastDot );
     }
-    
+
     //[0] prefix
     //[1] locale
     //[2] suffix
@@ -208,7 +210,7 @@
     {
         String suffix = "";
         int dot = name.indexOf( "." );
-        if ( dot > -1 ) 
+        if ( dot > -1 )
         { //remove file extension
             suffix = name.substring( dot );
             name = name.substring( 0, dot );
@@ -225,7 +227,7 @@
                 if ( loc1.length() != 2 )
                 {
                     break;
-                } 
+                }
                 locale = loc1 + ( locale == null ? "" : "_" + locale );
                 name = name.substring( 0, underscore );
             }
@@ -235,6 +237,9 @@
             }
             count = count + 1;
         }
-        return new String[] {name, locale, suffix};
+        return new String[]
+        {
+            name, locale, suffix
+        };
     }
 }
diff --git a/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java b/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
index 975bc43..b7864aa 100644
--- a/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -52,14 +51,16 @@
 import org.apache.tools.ant.util.StringUtils;
 
 /**
- * Build installers for Mavenized NetBeans application.
- * Creates installers for supported operating systems
- * and packages each installer as a deployable artifact.
- * <p>See a <a href="http://www.mojohaus.org/nbm-maven-plugin/buildinstexample.html">how-to</a> on customizing the installer.
+ * Build installers for Mavenized NetBeans application. Creates installers for supported operating systems and packages
+ * each installer as a deployable artifact.
+ * <p>
+ * See a <a href="http://www.mojohaus.org/nbm-maven-plugin/buildinstexample.html">how-to</a> on customizing the
+ * installer.
+ *
  * @author <a href="mailto:frantisek@mantlik.cz">Frantisek Mantlik</a>
  */
-@Mojo( name = "build-installers", 
-        requiresProject = true, 
+@Mojo( name = "build-installers",
+        requiresProject = true,
         requiresDependencyResolution = ResolutionScope.RUNTIME,
         threadSafe = true,
         defaultPhase = LifecyclePhase.PACKAGE )
@@ -68,24 +69,23 @@
 {
 
     /**
-    * output directory.
-    */
+     * output directory.
+     */
     @Parameter( defaultValue = "${project.build.directory}", required = true )
     protected File outputDirectory;
     /**
-    * The branding token for the application based on NetBeans platform.
-    */
+     * The branding token for the application based on NetBeans platform.
+     */
     @Parameter( property = "netbeans.branding.token", required = true )
     protected String brandingToken;
     /**
-    * Installation directory name at the destination system
-    * Deprecated, to be removed, was never actually used.
-    */
+     * Installation directory name at the destination system Deprecated, to be removed, was never actually used.
+     */
     @Parameter( property = "netbeans.branding.token" )
     protected String installDirName;
     /**
-    * Prefix of all generated installers files
-    */
+     * Prefix of all generated installers files
+     */
     @Parameter( defaultValue = "${project.build.finalName}" )
     private String installersFilePrefix;
     /**
@@ -119,21 +119,18 @@
     @Parameter( defaultValue = "${basedir}/license.txt" )
     private File installerLicenseFile;
     /**
-     * Custom installer template.
-     * This file, if provided, will replace default template from
+     * Custom installer template. This file, if provided, will replace default template from
      * &lt;NetBeansInstallation&gt;/harness/nbi/stub/template.xml
      */
     @Parameter
     private File templateFile;
     /**
-     * Parameters passed to templateFile 
-     * or to installer/nbi/stub/template.xml 
-     * to customize generated installers.
+     * Parameters passed to templateFile or to installer/nbi/stub/template.xml to customize generated installers.
      *
      */
     @Parameter
     private Map<String, String> userSettings;
-    
+
     /**
      * Name of the zip artifact used to produce installers from (without .zip extension)
      */
@@ -146,19 +143,19 @@
      */
     @Component
     private MavenProjectHelper projectHelper;
-        
+
     @Parameter( readonly = true, required = true, property = "basedir" )
     private File basedir;
     /**
-    * The Maven Project.
-    */
+     * The Maven Project.
+     */
     @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     // </editor-fold>
     @Override
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         Project antProject = antProject();
 
@@ -167,7 +164,7 @@
             throw new MojoExecutionException(
                     "This goal only makes sense on project with 'nbm-application' packaging." );
         }
-        
+
         if ( !installerOsLinux && !installerOsMacosx && !installerOsSolaris && !installerOsWindows )
         {
             getLog().warn( "None of the Operating System Installers selected, skipping 'build-installers' goal." );
@@ -179,7 +176,6 @@
         getLog().info( String.format( "Running Build Installers action for (existing=%2$s) zip file %1$s",
                 zipFile, zipFile.exists() ) );
 
-
         File appIconIcnsFile;
 
         // Copy Netbeans Installer resources
@@ -197,23 +193,25 @@
         appIconIcnsFile = new File( harnessDir, "etc" + File.separatorChar + "applicationIcon.icns" );
         getLog().info( "Application icon:" + appIconIcnsFile.getAbsolutePath() );
 
-        Map<String, String> props = new HashMap<String, String> ();
+        Map<String, String> props = new HashMap<String, String>();
 
         props.put( "suite.location", basedir.getAbsolutePath().replace( "\\", "/" ) );
         props.put( "suite.props.app.name", brandingToken );
         props.put( "suite.dist.zip", zipFile.getAbsolutePath().replace( "\\", "/" ) );
         props.put( "suite.dist.directory", outputDirectory.getAbsolutePath().replace( "\\", "/" ) );
-        props.put( "installer.build.dir", new File( outputDirectory, "installerbuild" ).getAbsolutePath().replace( "\\", "/" ) );
-        
+        props.put( "installer.build.dir", new File( outputDirectory, "installerbuild" ).getAbsolutePath().replace( "\\",
+                "/" ) );
+
         props.put( "installers.file.prefix", installersFilePrefix );
 
 //        props.put( "install.dir.name", installDirName );
-
         //mkleint: this is a flawed pattern! cannot make any assumption on multimodule layout
-        String appName = project.getParent().getArtifactId().replace( ".", "" ).replace( "-", "" ).replace( "_", "" ).replaceAll( "[0-9]+", "" );
+        String appName = project.getParent().getArtifactId().replace( ".", "" ).replace( "-", "" ).replace( "_", "" ).
+                replaceAll( "[0-9]+", "" );
         props.put( "suite.nbi.product.uid", appName.toLowerCase( Locale.ENGLISH ) );
 
-        props.put( "suite.props.app.title", ( project.getName() + " " + project.getVersion() ).replaceAll( "-SNAPSHOT", "" ) );
+        props.put( "suite.props.app.title", ( project.getName() + " " + project.getVersion() ).replaceAll( "-SNAPSHOT",
+                "" ) );
 
         String appVersion = project.getVersion().replaceAll( "-SNAPSHOT", "" );
         props.put( "suite.nbi.product.version.short", appVersion );
@@ -225,17 +223,22 @@
 
         props.put( "nbi.stub.location", new File( harnessDir, "nbi/stub" ).getAbsolutePath().replace( "\\", "/" ) );
 
-        props.put( "nbi.stub.common.location", new File( harnessDir, "nbi/.common" ).getAbsolutePath().replace( "\\", "/" ) );
+        props.put( "nbi.stub.common.location", new File( harnessDir, "nbi/.common" ).getAbsolutePath().replace( "\\",
+                "/" ) );
 
-        props.put( "nbi.ant.tasks.jar", new File( harnessDir, "modules/ext/nbi-ant-tasks.jar" ).getAbsolutePath().replace( "\\", "/" ) );
+        props.put( "nbi.ant.tasks.jar", new File( harnessDir, "modules/ext/nbi-ant-tasks.jar" ).getAbsolutePath().
+                replace( "\\", "/" ) );
 
-        props.put( "nbi.registries.management.jar", new File( harnessDir, "modules/ext/nbi-registries-management.jar" ).getAbsolutePath().replace( "\\", "/" ) );
+        props.put( "nbi.registries.management.jar", new File( harnessDir, "modules/ext/nbi-registries-management.jar" ).
+                getAbsolutePath().replace( "\\", "/" ) );
 
-        props.put( "nbi.engine.jar", new File( harnessDir, "modules/ext/nbi-engine.jar" ).getAbsolutePath().replace( "\\", "/" ) );
+        props.put( "nbi.engine.jar", new File( harnessDir, "modules/ext/nbi-engine.jar" ).getAbsolutePath().replace(
+                "\\", "/" ) );
 
         if ( installerLicenseFile != null )
         {
-            getLog().info( String.format( "License file is at %1s, exist = %2$s", installerLicenseFile, installerLicenseFile.exists() ) );
+            getLog().info( String.format( "License file is at %1s, exist = %2$s", installerLicenseFile,
+                    installerLicenseFile.exists() ) );
             props.put( "nbi.license.file", installerLicenseFile.getAbsolutePath() ); //mkleint: no path replacement here??
         }
 
@@ -299,7 +302,8 @@
 
         try
         {
-            antProject.setUserProperty( "ant.file", new File( harnessDir, "nbi/stub/template.xml" ).getAbsolutePath().replace( "\\", "/" ) );
+            antProject.setUserProperty( "ant.file", new File( harnessDir, "nbi/stub/template.xml" ).getAbsolutePath().
+                    replace( "\\", "/" ) );
             ProjectHelper helper = ProjectHelper.getProjectHelper();
             antProject.addReference( "ant.projectHelper", helper );
             helper.parse( antProject, new File( harnessDir, "nbi/stub/template.xml" ) );
@@ -327,7 +331,7 @@
     {
 
         boolean copyFile( final File toCopy, final File destFile )
-            throws MojoExecutionException
+                throws MojoExecutionException
         {
             try
             {
@@ -340,7 +344,7 @@
         }
 
         boolean copyFilesRecusively( final File toCopy, final File destDir )
-            throws MojoExecutionException
+                throws MojoExecutionException
         {
             assert destDir.isDirectory();
 
@@ -367,7 +371,7 @@
         }
 
         boolean copyJarResourcesRecursively( final File destDir, final JarURLConnection jarConnection )
-            throws IOException, MojoExecutionException
+                throws IOException, MojoExecutionException
         {
 
             final JarFile jarFile = jarConnection.getJarFile();
@@ -404,7 +408,7 @@
         }
 
         boolean copyResourcesRecursively( final URL originUrl, final File destination )
-            throws MojoExecutionException
+                throws MojoExecutionException
         {
             try
             {
@@ -425,7 +429,7 @@
         }
 
         boolean copyStream( final InputStream is, final File f )
-            throws MojoExecutionException
+                throws MojoExecutionException
         {
             try
             {
@@ -438,7 +442,7 @@
         }
 
         boolean copyStream( final InputStream is, final OutputStream os )
-            throws MojoExecutionException
+                throws MojoExecutionException
         {
             try
             {
diff --git a/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java b/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
index d7f5974..30aa29e 100644
--- a/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
+++ b/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
@@ -33,12 +33,12 @@
 import org.apache.netbeans.nbm.utils.ExamineManifest;
 
 /**
- * A dependency node visitor that collects visited nodes that are known libraries or are
- * children of known libraries
+ * A dependency node visitor that collects visited nodes that are known libraries or are children of known libraries
+ *
  * @author Milos Kleint
  */
 public class CollectLibrariesNodeVisitor
-    implements DependencyNodeVisitor
+        implements DependencyNodeVisitor
 {
 
     /**
@@ -68,6 +68,7 @@
 
     /**
      * Creates a dependency node visitor that collects visited nodes for further processing.
+     *
      * @param explicitLibraries list of explicit libraries
      * @param runtimeArtifacts list of runtime artifacts
      * @param examinerCache cache of netbeans manifest for artifacts
@@ -76,8 +77,8 @@
      * @param useOsgiDependencies whether to allow osgi dependencies or not
      */
     public CollectLibrariesNodeVisitor( List<String> explicitLibraries,
-        List<Artifact> runtimeArtifacts, Map<Artifact, ExamineManifest> examinerCache,
-        Log log, DependencyNode root, boolean useOsgiDependencies )
+            List<Artifact> runtimeArtifacts, Map<Artifact, ExamineManifest> examinerCache,
+            Log log, DependencyNode root, boolean useOsgiDependencies )
     {
         nodes = new ArrayList<Artifact>();
         artifacts = new HashMap<String, Artifact>();
@@ -132,7 +133,7 @@
                 if ( depExaminator.isNetBeansModule() )
                 {
                     log.warn(
-                        "You are using a NetBeans Module as a Library (classpath extension): " + artifact.getId() );
+                            "You are using a NetBeans Module as a Library (classpath extension): " + artifact.getId() );
                 }
 
                 nodes.add( artifact );
@@ -174,12 +175,12 @@
 
     /**
      * Gets the list of collected dependency nodes.
-     * 
+     *
      * @return the list of collected dependency nodes
      * @throws MojoExecutionException if a throwable is set
      */
     public List<Artifact> getArtifacts()
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         if ( throwable != null )
         {
diff --git a/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java b/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
index d052658..cbfe720 100644
--- a/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
+++ b/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
@@ -33,12 +33,12 @@
 import org.apache.netbeans.nbm.utils.ExamineManifest;
 
 /**
- * A dependency node visitor that collects visited nodes that are known libraries or are
- * children of known libraries
+ * A dependency node visitor that collects visited nodes that are known libraries or are children of known libraries
+ *
  * @author Milos Kleint
  */
 public class CollectModuleLibrariesNodeVisitor
-    implements DependencyNodeVisitor
+        implements DependencyNodeVisitor
 {
 
     /**
@@ -65,6 +65,7 @@
 
     /**
      * Creates a dependency node visitor that collects visited nodes for further processing.
+     *
      * @param runtimeArtifacts list of runtime artifacts
      * @param examinerCache cache of netbeans manifest for artifacts
      * @param log mojo logger
@@ -72,8 +73,8 @@
      * @param useOSGiDependencies whether to allow osgi dependencies or not
      */
     public CollectModuleLibrariesNodeVisitor(
-        List<Artifact> runtimeArtifacts, Map<Artifact, ExamineManifest> examinerCache,
-        Log log, DependencyNode root, boolean useOSGiDependencies )
+            List<Artifact> runtimeArtifacts, Map<Artifact, ExamineManifest> examinerCache,
+            Log log, DependencyNode root, boolean useOSGiDependencies )
     {
         directNodes = new HashMap<String, List<Artifact>>();
         transitiveNodes = new HashMap<String, List<Artifact>>();
@@ -139,7 +140,9 @@
             {
                 ////MNBMODULE-95 we are only interested in the module owned libraries
                 if ( !currentModule.peek().startsWith( LIB_ID )
-                        && AbstractNbmMojo.matchesLibrary( artifact, Collections.<String>emptyList(), depExaminator, log, useOSGiDependencies ) )
+                        && AbstractNbmMojo.
+                                matchesLibrary( artifact, Collections.<String>emptyList(), depExaminator, log,
+                                        useOSGiDependencies ) )
                 {
                     if ( currentModule.size() == 1 )
                     {
@@ -179,8 +182,8 @@
             return false;
         }
         if ( !currentModule.empty()
-            && ( currentModule.peek().equals( node.getArtifact().getDependencyConflictId() )
-                            || currentModule.peek().equals( LIB_ID + node.getArtifact().getDependencyConflictId() ) ) )
+                && ( currentModule.peek().equals( node.getArtifact().getDependencyConflictId() )
+                || currentModule.peek().equals( LIB_ID + node.getArtifact().getDependencyConflictId() ) ) )
         {
             currentModule.pop();
         }
@@ -189,11 +192,12 @@
 
     /**
      * modules declared in the project's pom
+     *
      * @return a map of module artifact lists, key is the dependencyConflictId
      * @throws MojoExecutionException if an unexpected problem occurs
      */
     public Map<String, List<Artifact>> getDeclaredArtifacts()
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         if ( throwable != null )
         {
@@ -204,11 +208,12 @@
 
     /**
      * modules that were picked up transitively
+     *
      * @return a map of module artifact lists, key is the dependencyConflictId
      * @throws MojoExecutionException if an unexpected problem occurs
      */
     public Map<String, List<Artifact>> getTransitiveArtifacts()
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         if ( throwable != null )
         {
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
index 126994d..f378763 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
@@ -84,18 +84,17 @@
 import org.netbeans.nbbuild.MakeListOfNBM;
 
 /**
- * Create the NetBeans module clusters/application for the 'nbm-application' packaging
- * projects
+ * Create the NetBeans module clusters/application for the 'nbm-application' packaging projects
  *
  * @author Milos Kleint
  */
-@Mojo( name = "cluster-app", 
+@Mojo( name = "cluster-app",
         defaultPhase = LifecyclePhase.PACKAGE,
-        requiresProject = true, 
+        requiresProject = true,
         threadSafe = true,
         requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class CreateClusterAppMojo
-    extends AbstractNbmMojo
+        extends AbstractNbmMojo
 {
 
     /**
@@ -117,66 +116,64 @@
     protected String brandingToken;
 
     /**
-     * Optional path to custom etc/${brandingToken}.conf file. If not defined,
-     * a default template will be used.
+     * Optional path to custom etc/${brandingToken}.conf file. If not defined, a default template will be used.
      */
     @Parameter( property = "netbeans.conf.file" )
     private File etcConfFile;
 
     /**
-     * Optional path to custom etc/${brandingToken}.clusters file. If not defined,
-     * a default one will be generated.
+     * Optional path to custom etc/${brandingToken}.clusters file. If not defined, a default one will be generated.
      */
     @Parameter( property = "netbeans.clusters.file" )
     private File etcClustersFile;
 
     /**
-     * Directory which contains the executables that will be copied to
-     * the final application's bin/ directory.
-     * Please note that the name of the executables shall generally
-     * match the brandingToken parameter. Otherwise the application can be wrongly branded.
+     * Directory which contains the executables that will be copied to the final application's bin/ directory. Please
+     * note that the name of the executables shall generally match the brandingToken parameter. Otherwise the
+     * application can be wrongly branded.
      */
     @Parameter( property = "netbeans.bin.directory" )
     private File binDirectory;
 
     /**
-     * If the depending NBM file doesn't contain any application cluster information,
-     * use this value as default location for such module NBMs.
+     * If the depending NBM file doesn't contain any application cluster information, use this value as default location
+     * for such module NBMs.
+     *
      * @since 3.2
      */
     @Parameter( defaultValue = "extra" )
     private String defaultCluster;
-    
+
     /**
-     * attempts to verify the integrity of module artifacts making sure that all dependencies are included
-     * and that all required tokens are provided
+     * attempts to verify the integrity of module artifacts making sure that all dependencies are included and that all
+     * required tokens are provided
+     *
      * @since 3.10
      */
     @Parameter( defaultValue = "true", property = "netbeans.verify.integrity" )
     private boolean verifyIntegrity;
-    
+
     /**
      * @since 4.12
      */
     @Parameter( defaultValue = "org.netbeans", property = "groupIdPrefix" )
     private String groupIdPrefix;
-    
-    private final Collection<String> defaultPlatformTokens = Arrays.asList( new String[] {
-                    "org.openide.modules.os.Windows",
-                    "org.openide.modules.os.Unix",
-                    "org.openide.modules.os.MacOSX",
-                    "org.openide.modules.os.OS2",
-                    "org.openide.modules.os.PlainUnix",    
-                    "org.openide.modules.os.Linux",
-                    "org.openide.modules.os.Solaris",
-                    "org.openide.modules.ModuleFormat1",
-                    "org.openide.modules.ModuleFormat2",
-                    "org.openide.modules.jre.JavaFX" //MNBMODULE-234
+
+    private final Collection<String> defaultPlatformTokens = Arrays.asList( new String[]
+    {
+        "org.openide.modules.os.Windows",
+        "org.openide.modules.os.Unix",
+        "org.openide.modules.os.MacOSX",
+        "org.openide.modules.os.OS2",
+        "org.openide.modules.os.PlainUnix",
+        "org.openide.modules.os.Linux",
+        "org.openide.modules.os.Solaris",
+        "org.openide.modules.ModuleFormat1",
+        "org.openide.modules.ModuleFormat2",
+        "org.openide.modules.jre.JavaFX" //MNBMODULE-234
     } );
 
-
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
-    
     @Component
     private ArtifactFactory artifactFactory;
 
@@ -192,10 +189,9 @@
 
 // end of component params custom code folding
 // </editor-fold>
-
     @Override
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
 
         File nbmBuildDirFile = new File( outputDirectory, brandingToken );
@@ -211,26 +207,28 @@
             Set<String> wrappedBundleCNBs = new HashSet<>( 100 );
             Map<String, Set<String>> clusterDependencies = new HashMap<>();
             Map<String, Set<String>> clusterModules = new HashMap<>();
-            
+
             //verify integrity
-            Set<String> modulesCNBs = new HashSet<>( 200 );
-            Set<String> dependencyCNBs = new HashSet<>( 200 );
-            Map<String, Set<String>> dependencyCNBBacktraces = new HashMap<>( 50 );
-            Set<String> requireTokens = new HashSet<>( 50 );
-            Map<String, Set<String>> requireTokensBacktraces = new HashMap<>( 50 );
-            Set<String> provideTokens = new HashSet<>( 50 );
-            Set<String> osgiImports = new HashSet<>( 50 );
-            Map<String, Set<String>> osgiImportsBacktraces = new HashMap<>( 50 );
-            Set<String> osgiExports = new HashSet<>( 50 );
-            Set<String> osgiExportsSubs = new HashSet<>( 50 ); //a way to deal with nb module declaring xxx.** (subpackages) declaration that is consumed by osgi imports
-            
+            Set<String> modulesCNBs = new HashSet<>( SET_INITIAL_SIZE );
+            Set<String> dependencyCNBs = new HashSet<>( SET_INITIAL_SIZE );
+            Map<String, Set<String>> dependencyCNBBacktraces = new HashMap<>( MAP_INITIALSIZE );
+            Set<String> requireTokens = new HashSet<>( MAP_INITIALSIZE );
+            Map<String, Set<String>> requireTokensBacktraces = new HashMap<>( MAP_INITIALSIZE );
+            Set<String> provideTokens = new HashSet<>( MAP_INITIALSIZE );
+            Set<String> osgiImports = new HashSet<>( MAP_INITIALSIZE );
+            Map<String, Set<String>> osgiImportsBacktraces = new HashMap<>( MAP_INITIALSIZE );
+            Set<String> osgiExports = new HashSet<>( MAP_INITIALSIZE );
+            Set<String> osgiExportsSubs = new HashSet<>( MAP_INITIALSIZE ); //a way to deal with nb module declaring xxx.** (subpackages) declaration that is consumed by osgi imports
+
             List<BundleTuple> bundles = new ArrayList<>();
 
             @SuppressWarnings( "unchecked" )
             Set<Artifact> artifacts = project.getArtifacts();
             for ( Artifact art : artifacts )
             {
-                ArtifactResult res = turnJarToNbmFile( art, artifactFactory, artifactResolver, project, localRepository );
+                ArtifactResult res
+                                       = turnJarToNbmFile( art, artifactFactory, artifactResolver, project,
+                                                           localRepository );
                 if ( res.hasConvertedArtifact() )
                 {
                     art = res.getConvertedArtifact();
@@ -245,210 +243,222 @@
                         {
                             String clusterName = findCluster( jf );
                             ClusterTuple cluster = processCluster( clusterName, nbmBuildDirFile, art );
-                            
-                                getLog().debug( "Copying " + art.getId() + " to cluster " + clusterName );
-                                Enumeration<JarEntry> enu = jf.entries();
 
-                                // we need to trigger this ant task to generate the update_tracking file.
-                                MakeListOfNBM makeTask = (MakeListOfNBM) antProject.createTask( "genlist" );
-                                antProject.setNewProperty( "module.name", art.getFile().getName() ); // TODO
-                                antProject.setProperty( "cluster.dir", clusterName );
-                                FileSet set = makeTask.createFileSet();
-                                set.setDir( cluster.location );
-                                makeTask.setOutputfiledir( cluster.location );
-                                String[] executables = null;
-                                File classpathRoot = null;
-                                String classPath = null;
-                                while ( enu.hasMoreElements() )
+                            getLog().debug( "Copying " + art.getId() + " to cluster " + clusterName );
+                            Enumeration<JarEntry> enu = jf.entries();
+
+                            // we need to trigger this ant task to generate the update_tracking file.
+                            MakeListOfNBM makeTask = (MakeListOfNBM) antProject.createTask( "genlist" );
+                            antProject.setNewProperty( "module.name", art.getFile().getName() ); // TODO
+                            antProject.setProperty( "cluster.dir", clusterName );
+                            FileSet set = makeTask.createFileSet();
+                            set.setDir( cluster.location );
+                            makeTask.setOutputfiledir( cluster.location );
+                            String[] executables = null;
+                            File classpathRoot = null;
+                            String classPath = null;
+                            while ( enu.hasMoreElements() )
+                            {
+                                JarEntry ent = enu.nextElement();
+                                String name = ent.getName();
+                                //MNBMODULE-176
+                                if ( name.equals( "Info/executables.list" ) )
                                 {
-                                    JarEntry ent = enu.nextElement();
-                                    String name = ent.getName();
-                                    //MNBMODULE-176
-                                    if ( name.equals( "Info/executables.list" ) )
+                                    if ( cluster.newer )
                                     {
-                                        if ( cluster.newer )
+                                        InputStream is = jf.getInputStream( ent );
+                                        executables = StringUtils.split( IOUtil.toString( is, "UTF-8" ), "\n" );
+                                    }
+                                }
+                                else if ( name.startsWith( "netbeans/" ) )
+                                { // ignore everything else.
+                                    String path = clusterName + name.substring( "netbeans".length() );
+                                    boolean ispack200 = path.endsWith( ".jar.pack.gz" );
+                                    if ( ispack200 )
+                                    {
+                                        path = path.replace( ".jar.pack.gz", ".jar" );
+                                    }
+                                    File fl = new File( nbmBuildDirFile, path.replace( "/", File.separator ) );
+                                    String part = name.substring( "netbeans/".length() );
+                                    if ( ispack200 )
+                                    {
+                                        part = part.replace( ".jar.pack.gz", ".jar" );
+                                    }
+                                    if ( cluster.newer )
+                                    {
+                                        if ( ent.isDirectory() )
+                                        {
+                                            fl.mkdirs();
+                                        }
+                                        else if ( path.endsWith( ".external" ) ) // MNBMODULE-138
                                         {
                                             InputStream is = jf.getInputStream( ent );
-                                            executables = StringUtils.split( IOUtil.toString( is, "UTF-8" ), "\n" );
-                                        }
-                                    }
-                                    else if ( name.startsWith( "netbeans/" ) )
-                                    { // ignore everything else.
-                                        String path = clusterName + name.substring( "netbeans".length() );
-                                        boolean ispack200 = path.endsWith( ".jar.pack.gz" );
-                                        if ( ispack200 )
-                                        {
-                                            path = path.replace( ".jar.pack.gz", ".jar" );
-                                        }
-                                        File fl = new File( nbmBuildDirFile, path.replace( "/", File.separator ) );
-                                        String part = name.substring( "netbeans/".length() );
-                                        if ( ispack200 )
-                                        {
-                                            part = part.replace( ".jar.pack.gz", ".jar" );
-                                        }
-                                        if ( cluster.newer )
-                                        {
-                                            if ( ent.isDirectory() )
+                                            try
                                             {
-                                                fl.mkdirs();
+                                                externalDownload( new File( fl.getParentFile(),
+                                                                            fl.getName().replaceFirst( "[.]external$",
+                                                                                                       "" ) ), is );
                                             }
-                                            else if ( path.endsWith( ".external" ) ) // MNBMODULE-138
+                                            finally
                                             {
-                                                InputStream is = jf.getInputStream( ent );
-                                                try
-                                                {
-                                                    externalDownload( new File( fl.getParentFile(),
-                                                                                fl.getName().replaceFirst( "[.]external$",
-                                                                                                           "" ) ), is );
-                                                }
-                                                finally
-                                                {
-                                                    is.close();
-                                                }
-                                                //MNBMODULE-192
-                                                set.appendIncludes( new String[] { name.substring( "netbeans/".length(), name.length() - ".external".length() ) } );
+                                                is.close();
                                             }
-                                            else
+                                            //MNBMODULE-192
+                                            set.appendIncludes( new String[]
                                             {
-                                                set.appendIncludes( new String[] { part } );
+                                                name.substring( "netbeans/".length(), name.length() - ".external".
+                                                                length() )
+                                            } );
+                                        }
+                                        else
+                                        {
+                                            set.appendIncludes( new String[]
+                                            {
+                                                part
+                                            } );
 
-                                                fl.getParentFile().mkdirs();
-                                                fl.createNewFile();
-                                                BufferedOutputStream outstream = null;
-                                                try
-                                                {
-                                                    outstream = new BufferedOutputStream( new FileOutputStream( fl ) );
-                                                    InputStream instream = jf.getInputStream( ent );
-                                                    if ( ispack200 )
-                                                    {
-                                                        Pack200.Unpacker unp = Pack200.newUnpacker();
-                                                        JarOutputStream jos = new JarOutputStream( outstream );
-                                                        GZIPInputStream gzip = new GZIPInputStream( instream );
-                                                        try
-                                                        {
-                                                            unp.unpack( gzip, jos );
-                                                        }
-                                                        finally
-                                                        {
-                                                            jos.close();
-                                                        }
-                                                    }
-                                                    else
-                                                    {
-                                                        IOUtil.copy( instream, outstream );
-                                                    }
-                                                }
-                                                finally
-                                                {
-                                                    IOUtil.close( outstream );
-                                                }
-                                            }
-                                        }
-                                            
-                                            //TODO examine netbeans/config/Modules to see if the module is autoload/eager
-                                            // in verifyIntegrity these could be handled more gracefully than regular modules.
-                                            //eager is simpler, does not need to have module dependencies satisfied.
-                                            //autoload needs checking if any of the other modules declares a dependency on it. if not, also safe to ignore?
-                                            
-                                            
-                                            // now figure which one of the jars is the module jar..
-                                            if ( part.matches( "(modules|core|lib)/[^/]+[.]jar" ) )
+                                            fl.getParentFile().mkdirs();
+                                            fl.createNewFile();
+                                            BufferedOutputStream outstream = null;
+                                            try
                                             {
-                                                ExamineManifest ex = new ExamineManifest( getLog() );
-                                                ex.setJarFile( fl );
-                                                ex.setPopulateDependencies( true );
-                                                ex.checkFile();
-                                                if ( ex.isNetBeansModule() )
+                                                outstream = new BufferedOutputStream( new FileOutputStream( fl ) );
+                                                InputStream instream = jf.getInputStream( ent );
+                                                if ( ispack200 )
                                                 {
-                                                    makeTask.setModule( part );
-                                                    addToMap( clusterDependencies, clusterName, ex.getDependencyTokens() );
-                                                    addToMap( clusterModules, clusterName, Collections.singletonList( ex.getModule() ) );
-                                                    if ( ex.getClasspath().length() > 0 )
-                                                    { //MNBMODULE-220
-                                                        classPath = ex.getClasspath();
-                                                        classpathRoot = fl.getParentFile();
-                                                    }
-                                                }
-                                                if ( verifyIntegrity )
-                                                {
-                                                    dependencyCNBs.addAll( ex.getDependencyTokens() );
-                                                    modulesCNBs.add( ex.getModule() );
-                                                    for ( String d : ex.getDependencyTokens() )
+                                                    Pack200.Unpacker unp = Pack200.newUnpacker();
+                                                    JarOutputStream jos = new JarOutputStream( outstream );
+                                                    GZIPInputStream gzip = new GZIPInputStream( instream );
+                                                    try
                                                     {
-                                                        addToMap( dependencyCNBBacktraces, d, Collections.singletonList( ex.getModule() ) );
+                                                        unp.unpack( gzip, jos );
                                                     }
-                                                    if ( ex.isNetBeansModule() )
+                                                    finally
                                                     {
-                                                        requireTokens.addAll( ex.getNetBeansRequiresTokens() );
-                                                        for ( String r : ex.getNetBeansRequiresTokens() )
-                                                        {
-                                                            addToMap( requireTokensBacktraces, r, Collections.singletonList( ex.getModule() ) );
-                                                        }
-                                                        provideTokens.addAll( ex.getNetBeansProvidesTokens() );
-                                                        for ( String pack : ex.getPackages() )
-                                                        {
-                                                            if ( pack.endsWith( ".**" ) )
-                                                            {
-                                                                //what to do with subpackages?
-                                                                pack = pack.substring( 0, pack.length() - ".**".length() );
-                                                                osgiExportsSubs.add( pack );
-                                                            } 
-                                                            else if ( pack.endsWith( ".*" ) )
-                                                            {
-                                                                pack = pack.substring( 0, pack.length() - ".*".length() );
-                                                                osgiExports.add( pack );
-                                                            }
-                                                        }
-                                                        
+                                                        jos.close();
                                                     }
                                                 }
-                                            }
-                                        }
-                                    }
-                                    if ( classPath != null )
-                                    { //MNBMODULE-220 collect wrappedbundleCNBs, later useful in assignClustersToBundles(), these get removed from list of bundles.
-                                        String[] paths = StringUtils.split( classPath, " " );
-                                        for ( String path : paths )
-                                        {
-                                            path = path.trim();
-                                            File classpathFile = new File( classpathRoot, path );
-                                            if ( path.equals( "${java.home}/lib/ext/jfxrt.jar" ) )
-                                            { //MNBMODULE-228
-                                                String jhm = System.getProperty( "java.home" );
-                                                classpathFile = new File( new File( new File( new File( jhm ), "lib" ), "ext" ), "jfxrt.jar" );
-                                                if ( !classpathFile.exists() )
-                                                {
-                                                    File jdk7 = new File( new File( new File( jhm ), "lib" ), "jfxrt.jar" );
-                                                    if ( jdk7.exists() )
-                                                    {
-                                                        classpathFile = jdk7;
-                                                    }
-                                                }
-                                            }
-                                            if ( !classpathFile.isFile() )
-                                            {
-                                                getLog().warn( "Could not resolve Class-Path item in " + art.getId() + ", path is:" + path +  ", skipping" );
-                                                continue; //try to guard against future failures
-                                            }
-                                            ExamineManifest ex = new ExamineManifest( getLog() );
-                                            ex.setJarFile( classpathFile );
-                                            //ex.setPopulateDependencies( true );
-                                            ex.checkFile();
-                                            if ( ex.isOsgiBundle() )
-                                            {
-                                                if ( art.getId().contains( groupIdPrefix + ".modules:org-netbeans-modules-maven-embedder" ) )
-                                                {
-                                                    // in this case we dont want module-maven-embedder to be considered as wrapper for his libs                                                     
-                                                    // guava is provided but ide have it also 
-                                                }
                                                 else
                                                 {
-                                                    getLog().info( ex.getModule() + " added by " + art.getId() + "" + classpathFile );
-                                                    wrappedBundleCNBs.add( ex.getModule() );
+                                                    IOUtil.copy( instream, outstream );
                                                 }
                                             }
+                                            finally
+                                            {
+                                                IOUtil.close( outstream );
+                                            }
                                         }
                                     }
+
+                                    //TODO examine netbeans/config/Modules to see if the module is autoload/eager
+                                    // in verifyIntegrity these could be handled more gracefully than regular modules.
+                                    //eager is simpler, does not need to have module dependencies satisfied.
+                                    //autoload needs checking if any of the other modules declares a dependency on it. if not, also safe to ignore?
+                                    // now figure which one of the jars is the module jar..
+                                    if ( part.matches( "(modules|core|lib)/[^/]+[.]jar" ) )
+                                    {
+                                        ExamineManifest ex = new ExamineManifest( getLog() );
+                                        ex.setJarFile( fl );
+                                        ex.setPopulateDependencies( true );
+                                        ex.checkFile();
+                                        if ( ex.isNetBeansModule() )
+                                        {
+                                            makeTask.setModule( part );
+                                            addToMap( clusterDependencies, clusterName, ex.getDependencyTokens() );
+                                            addToMap( clusterModules, clusterName, Collections.singletonList( ex.
+                                                      getModule() ) );
+                                            if ( ex.getClasspath().length() > 0 )
+                                            { //MNBMODULE-220
+                                                classPath = ex.getClasspath();
+                                                classpathRoot = fl.getParentFile();
+                                            }
+                                        }
+                                        if ( verifyIntegrity )
+                                        {
+                                            dependencyCNBs.addAll( ex.getDependencyTokens() );
+                                            modulesCNBs.add( ex.getModule() );
+                                            for ( String d : ex.getDependencyTokens() )
+                                            {
+                                                addToMap( dependencyCNBBacktraces, d, Collections.singletonList( ex.
+                                                          getModule() ) );
+                                            }
+                                            if ( ex.isNetBeansModule() )
+                                            {
+                                                requireTokens.addAll( ex.getNetBeansRequiresTokens() );
+                                                for ( String r : ex.getNetBeansRequiresTokens() )
+                                                {
+                                                    addToMap( requireTokensBacktraces, r, Collections.singletonList( ex.
+                                                              getModule() ) );
+                                                }
+                                                provideTokens.addAll( ex.getNetBeansProvidesTokens() );
+                                                for ( String pack : ex.getPackages() )
+                                                {
+                                                    if ( pack.endsWith( ".**" ) )
+                                                    {
+                                                        //what to do with subpackages?
+                                                        pack = pack.substring( 0, pack.length() - ".**".length() );
+                                                        osgiExportsSubs.add( pack );
+                                                    }
+                                                    else if ( pack.endsWith( ".*" ) )
+                                                    {
+                                                        pack = pack.substring( 0, pack.length() - ".*".length() );
+                                                        osgiExports.add( pack );
+                                                    }
+                                                }
+
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                            if ( classPath != null )
+                            { //MNBMODULE-220 collect wrappedbundleCNBs, later useful in assignClustersToBundles(), these get removed from list of bundles.
+                                String[] paths = StringUtils.split( classPath, " " );
+                                for ( String path : paths )
+                                {
+                                    path = path.trim();
+                                    File classpathFile = new File( classpathRoot, path );
+                                    if ( path.equals( "${java.home}/lib/ext/jfxrt.jar" ) )
+                                    { //MNBMODULE-228
+                                        String jhm = System.getProperty( "java.home" );
+                                        classpathFile = new File( new File( new File( new File( jhm ), "lib" ), "ext" ),
+                                                                  "jfxrt.jar" );
+                                        if ( !classpathFile.exists() )
+                                        {
+                                            File jdk7 = new File( new File( new File( jhm ), "lib" ), "jfxrt.jar" );
+                                            if ( jdk7.exists() )
+                                            {
+                                                classpathFile = jdk7;
+                                            }
+                                        }
+                                    }
+                                    if ( !classpathFile.isFile() )
+                                    {
+                                        getLog().warn( "Could not resolve Class-Path item in " + art.getId()
+                                                + ", path is:" + path + ", skipping" );
+                                        continue; //try to guard against future failures
+                                    }
+                                    ExamineManifest ex = new ExamineManifest( getLog() );
+                                    ex.setJarFile( classpathFile );
+                                    //ex.setPopulateDependencies( true );
+                                    ex.checkFile();
+                                    if ( ex.isOsgiBundle() )
+                                    {
+                                        if ( art.getId().contains( groupIdPrefix
+                                                + ".modules:org-netbeans-modules-maven-embedder" ) )
+                                        {
+                                            // in this case we dont want module-maven-embedder to be considered as wrapper for his libs                                                     
+                                            // guava is provided but ide have it also 
+                                        }
+                                        else
+                                        {
+                                            getLog().info( ex.getModule() + " added by " + art.getId() + ""
+                                                    + classpathFile );
+                                            wrappedBundleCNBs.add( ex.getModule() );
+                                        }
+                                    }
+                                }
+                            }
                             if ( cluster.newer )
                             {
                                 try
@@ -475,7 +485,7 @@
                                     }
                                 }
                             }
-                            
+
                         }
                         finally
                         {
@@ -491,7 +501,7 @@
                 {
                     ExamineManifest ex = res.getExaminedManifest();
                     bundles.add( new BundleTuple( art, ex ) );
-                    if ( verifyIntegrity ) 
+                    if ( verifyIntegrity )
                     {
                         dependencyCNBs.addAll( ex.getDependencyTokens() );
                         for ( String d : ex.getDependencyTokens() )
@@ -504,12 +514,12 @@
                         {
                             addToMap( osgiImportsBacktraces, d, Collections.singletonList( ex.getModule() ) );
                         }
-                        
+
                         osgiExports.addAll( ex.getOsgiExports() );
                     }
-                } 
+                }
             }
-            
+
             if ( verifyIntegrity )
             {
                 if ( getLog().isDebugEnabled() )
@@ -528,11 +538,11 @@
                 while ( it.hasNext() )
                 {
                     String s = it.next();
-                    if ( s.startsWith( "java." ) 
-                            || s.startsWith( "javax." ) 
-                            || s.startsWith( "sun." ) 
-                            || s.startsWith( "org.xml.sax" ) 
-                            || s.startsWith( "org.w3c.dom" ) 
+                    if ( s.startsWith( "java." )
+                            || s.startsWith( "javax." )
+                            || s.startsWith( "sun." )
+                            || s.startsWith( "org.xml.sax" )
+                            || s.startsWith( "org.w3c.dom" )
                             || s.startsWith( "org.ietf.jgss" ) )
                     {
                         it.remove();
@@ -553,32 +563,39 @@
                 {
                     if ( !dependencyCNBs.isEmpty() )
                     {
-                        getLog().error( "Some included modules/bundles depend on these codenamebases but they are not included. The application will fail starting up. The missing codenamebases are:" );
+                        getLog().error(
+                                "Some included modules/bundles depend on these codenamebases but they are not included. The application will fail starting up. The missing codenamebases are:" );
                         for ( String s : dependencyCNBs )
                         {
                             Set<String> back = dependencyCNBBacktraces.get( s );
-                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.toArray() ) : "" ) );
+                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.
+                                    toArray() ) : "" ) );
                         }
                     }
                     if ( !osgiImports.isEmpty() )
                     {
-                        getLog().error( "Some OSGi imports are not satisfied by included bundles' exports. The application will fail starting up. The missing imports are:" );
+                        getLog().error(
+                                "Some OSGi imports are not satisfied by included bundles' exports. The application will fail starting up. The missing imports are:" );
                         for ( String s : osgiImports )
                         {
                             Set<String> back = osgiImportsBacktraces.get( s );
-                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.toArray() ) : "" ) );
+                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.
+                                    toArray() ) : "" ) );
                         }
                     }
                     if ( !requireTokens.isEmpty() )
                     {
-                        getLog().error( "Some tokens required by included modules are not provided by included modules. The application will fail starting up. The missing tokens are:" );
+                        getLog().error(
+                                "Some tokens required by included modules are not provided by included modules. The application will fail starting up. The missing tokens are:" );
                         for ( String s : requireTokens )
                         {
                             Set<String> back = requireTokensBacktraces.get( s );
-                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.toArray() ) : "" ) );
+                            getLog().error( "   " + s + ( back != null ? "          ref: " + Arrays.toString( back.
+                                    toArray() ) : "" ) );
                         }
                     }
-                    throw new MojoFailureException( "See above for consistency validation check failures. Either fix those by adding the relevant dependencies to the application or disable the check by setting the verifyIntegrity parameter to false or by running with -Dnetbeans.verify.integrity=false cmd line parameter." );
+                    throw new MojoFailureException(
+                            "See above for consistency validation check failures. Either fix those by adding the relevant dependencies to the application or disable the check by setting the verifyIntegrity parameter to false or by running with -Dnetbeans.verify.integrity=false cmd line parameter." );
                 }
                 else
                 {
@@ -597,7 +614,6 @@
             //now assign the cluster to bundles based on dependencies..
             assignClustersToBundles( bundles, wrappedBundleCNBs, clusterDependencies, cluster2depClusters, getLog() );
 
-
             for ( BundleTuple ent : bundles )
             {
                 Artifact art = ent.artifact;
@@ -608,7 +624,7 @@
                 {
                     clstr = defaultCluster;
                 }
-                
+
                 ClusterTuple cluster = processCluster( clstr, nbmBuildDirFile, art );
                 if ( cluster.newer )
                 {
@@ -633,7 +649,8 @@
                             @Override
                             public InputStream getInputStream() throws IOException
                             {
-                                return new StringInputStream( createBundleConfigFile( cnb, ex.isBundleAutoload() ), "UTF-8" );
+                                return new StringInputStream( createBundleConfigFile( cnb, ex.isBundleAutoload() ),
+                                                              "UTF-8" );
                             }
                         }, moduleConf );
                         FileUtils.copyStreamToFile( new InputStreamFacade()
@@ -641,7 +658,8 @@
                             @Override
                             public InputStream getInputStream() throws IOException
                             {
-                                return new StringInputStream( createBundleUpdateTracking( cnb, moduleArt, moduleConf, specVer ), "UTF-8" );
+                                return new StringInputStream( createBundleUpdateTracking( cnb, moduleArt, moduleConf,
+                                                                                          specVer ), "UTF-8" );
                             }
                         }, new File( updateTracking, cnbDashed + ".xml" ) );
                     }
@@ -653,13 +671,13 @@
             }
 
             getLog().info(
-                "Created NetBeans module cluster(s) at " + nbmBuildDirFile.getAbsoluteFile() );
+                    "Created NetBeans module cluster(s) at " + nbmBuildDirFile.getAbsoluteFile() );
 
         }
         else
         {
             throw new MojoExecutionException(
-                "This goal only makes sense on project with nbm-application packaging" );
+                    "This goal only makes sense on project with nbm-application packaging" );
         }
         //in 6.1 the rebuilt modules will be cached if the timestamp is not touched.
         File[] files = nbmBuildDirFile.listFiles();
@@ -689,14 +707,16 @@
         catch ( IOException ex )
         {
             throw new MojoExecutionException(
-                "Cannot process etc folder content creation.", ex );
+                    "Cannot process etc folder content creation.", ex );
         }
     }
+    private static final int SET_INITIAL_SIZE = 200;
+    private static final int MAP_INITIALSIZE = 50;
     private static final Pattern PATT = Pattern.compile(
-        ".*targetcluster=\"([a-zA-Z0-9_\\.\\-]+)\".*", Pattern.DOTALL );
+            ".*targetcluster=\"([a-zA-Z0-9_\\.\\-]+)\".*", Pattern.DOTALL );
 
     private String findCluster( JarFile jf )
-        throws MojoFailureException, IOException
+            throws MojoFailureException, IOException
     {
         ZipEntry entry = jf.getEntry( "Info/info.xml" );
         InputStream ins = jf.getInputStream( entry );
@@ -705,7 +725,7 @@
         if ( !m.matches() )
         {
             getLog().info( "Cannot find cluster for " + jf.getName() + " Falling back to default value - '"
-                               + defaultCluster + "'." );
+                    + defaultCluster + "'." );
             return defaultCluster;
         }
         else
@@ -715,20 +735,19 @@
     }
 
     /**
-     * 
+     *
      * @param buildDir Directory where the platform bundle is built
      * @param brandingToken
-     * 
+     *
      * @throws java.io.IOException
      */
     private void createBinEtcDir( File buildDir, String brandingToken )
-        throws IOException, MojoExecutionException
+            throws IOException, MojoExecutionException
     {
         File etcDir = new File( buildDir + File.separator + "etc" );
         etcDir.mkdir();
 
         // create app.clusters which contains a list of clusters to include in the application
-
         File clusterConf = new File( etcDir + File.separator + brandingToken + ".clusters" );
         String clustersString;
         if ( etcClustersFile != null )
@@ -770,7 +789,7 @@
             {
                 str = FileUtils.fileRead( confFile, "UTF-8" );
             }
-            else 
+            else
             {
                 getLog().debug( "Using fallback app.conf shipping with the nbm-maven-plugin." );
                 InputStream instream = null;
@@ -790,7 +809,7 @@
             str = FileUtils.fileRead( confFile, "UTF-8" );
         }
         File confDestFile = new File(
-            etcDir.getAbsolutePath() + File.separator + brandingToken + ".conf" );
+                etcDir.getAbsolutePath() + File.separator + brandingToken + ".conf" );
 
         str = str.replace( "${branding.token}", brandingToken );
         FileUtils.fileWrite( confDestFile.getAbsolutePath(), "UTF-8", str );
@@ -804,7 +823,6 @@
         File destExe64 = new File( destBinDir, brandingToken + "64.exe" );
         File destSh = new File( destBinDir, brandingToken );
 
-
         File harnessDir = new File( buildDir, "harness" );
         //we have org-netbeans-modules-apisupport-harness in target area, just use it's own launchers.
         binDir = new File(
@@ -831,14 +849,15 @@
             File nbm = getHarnessNbm();
             try ( ZipFile zip = new ZipFile( nbm ) )
             {
-                getLog().debug( "Using fallback executables from downloaded org-netbeans-modules-apisupport-harness nbm file." );
-                writeFromZip( zip, "netbeans/launchers/app.sh",  destSh, true );
-                writeFromZip( zip, "netbeans/launchers/app.exe",  destExe, true );
-                writeFromZip( zip, "netbeans/launchers/app64.exe",  destExe64, false );
-                writeFromZip( zip, "netbeans/launchers/app_w.exe",  destExeW, false );
+                getLog().debug(
+                        "Using fallback executables from downloaded org-netbeans-modules-apisupport-harness nbm file." );
+                writeFromZip( zip, "netbeans/launchers/app.sh", destSh, true );
+                writeFromZip( zip, "netbeans/launchers/app.exe", destExe, true );
+                writeFromZip( zip, "netbeans/launchers/app64.exe", destExe64, false );
+                writeFromZip( zip, "netbeans/launchers/app_w.exe", destExeW, false );
             }
         }
-        
+
         if ( binDirectory != null )
         {
             //we have custom launchers, only overwrite the ones the user provided.
@@ -852,7 +871,7 @@
             {
                 String name = fl.getName();
                 File dest = null;
-                if ( name.endsWith( "_w.exe" ) ) 
+                if ( name.endsWith( "_w.exe" ) )
                 {
                     dest = destExeW;
                 }
@@ -868,7 +887,7 @@
                 {
                     dest = destSh;
                 }
-                if ( dest != null  && fl.exists() ) //in 6.7 the _w.exe file is no more.
+                if ( dest != null && fl.exists() ) //in 6.7 the _w.exe file is no more.
                 {
                     FileUtils.copyFile( fl, dest );
                 }
@@ -891,7 +910,7 @@
     }
 
     private void writeFile( String path, File destSh )
-        throws IOException
+            throws IOException
     {
         InputStream instream = null;
         OutputStream output = null;
@@ -933,8 +952,8 @@
         return new ClusterTuple( clusterFile, newer );
     }
 
-        private void externalDownload( File f, InputStream is )
-        throws IOException
+    private void externalDownload( File f, InputStream is )
+            throws IOException
     {
         // Cf. org.netbeans.nbbuild.AutoUpdate
         BufferedReader r = new BufferedReader( new InputStreamReader( is, "UTF-8" ) );
@@ -950,24 +969,27 @@
             }
             else if ( line.startsWith( "URL:" ) )
             {
-                String rest = line.substring(4).trim();
+                String rest = line.substring( 4 ).trim();
                 if ( rest.startsWith( "m2:/" ) )
                 {
-                    if ( ! found )
+                    if ( !found )
                     {
                         String[] coords = rest.substring( 4 ).trim().split( ":" );
                         Artifact artifact;
                         if ( coords.length == 4 )
                         {
-                            artifact = artifactFactory.createArtifact( coords[0], coords[1], coords[2], null, coords[3] );
+                            artifact = artifactFactory.
+                                    createArtifact( coords[0], coords[1], coords[2], null, coords[3] );
                         }
                         else
                         {
-                            artifact = artifactFactory.createArtifactWithClassifier( coords[0], coords[1], coords[2], coords[3], coords[4] );
+                            artifact = artifactFactory.createArtifactWithClassifier( coords[0], coords[1], coords[2],
+                                                                                     coords[3], coords[4] );
                         }
                         try
                         {
-                            artifactResolver.resolve( artifact, project.getRemoteArtifactRepositories(), localRepository );
+                            artifactResolver.
+                                    resolve( artifact, project.getRemoteArtifactRepositories(), localRepository );
                             FileUtils.copyFile( artifact.getFile(), f );
                             found = true;
                         }
@@ -977,7 +999,7 @@
                         }
                     }
                 }
-                else if ( ! found )
+                else if ( !found )
                 {
                     String url = line.substring( 4 ).trim();
                     try
@@ -1001,7 +1023,7 @@
                 getLog().warn( "Unrecognized line: " + line );
             }
         }
-        if ( ! found )
+        if ( !found )
         {
             throw new IOException( "Could not download " + f );
         }
@@ -1022,7 +1044,8 @@
         String version = null;
         for ( Artifact a : artifacts )
         {
-            if ( ( groupIdPrefix + ".modules" ).equals( a.getGroupId() ) && "org-netbeans-bootstrap".equals( a.getArtifactId() ) )
+            if ( ( groupIdPrefix + ".modules" ).equals( a.getGroupId() ) && "org-netbeans-bootstrap".equals( a.
+                    getArtifactId() ) )
             {
                 version = a.getBaseVersion(); //base version in non-snapshot should equals version, in snapshots to X-SNAPSHOT, not timestamp
                 break;
@@ -1030,14 +1053,15 @@
         }
         if ( version == null )
         {
-            throw new MojoExecutionException( "We could not find org-netbeans-bootstrap among the modules in the application. Launchers could not be found." );
+            throw new MojoExecutionException(
+                    "We could not find org-netbeans-bootstrap among the modules in the application. Launchers could not be found." );
         }
         Artifact nbmArt = artifactFactory.createArtifact(
-            groupIdPrefix + ".modules",
-            "org-netbeans-modules-apisupport-harness",
-            version,
-            "compile",
-            "nbm-file" );
+                groupIdPrefix + ".modules",
+                "org-netbeans-modules-apisupport-harness",
+                version,
+                "compile",
+                "nbm-file" );
         try
         {
             artifactResolver.resolve( nbmArt, project.getRemoteArtifactRepositories(), localRepository );
@@ -1050,7 +1074,8 @@
         return nbmArt.getFile();
     }
 
-    private void writeFromZip( final ZipFile zip, String zipPath, File destFile, boolean mandatory ) throws MojoExecutionException, IOException
+    private void writeFromZip( final ZipFile zip, String zipPath, File destFile, boolean mandatory ) throws
+            MojoExecutionException, IOException
     {
         final ZipEntry path = zip.getEntry( zipPath );
         if ( path == null )
@@ -1064,7 +1089,7 @@
         }
         FileUtils.copyStreamToFile( new InputStreamFacade()
         {
-            
+
             @Override
             public InputStream getInputStream() throws IOException
             {
@@ -1086,7 +1111,7 @@
             lst.addAll( newValues );
         }
     }
-    
+
     private static List<String> findByDependencies( Map<String, Set<String>> clusterDependencies, String spec )
     {
         List<String> toRet = new ArrayList<>();
@@ -1108,7 +1133,9 @@
     //A few unsolved cases:
     // - we never update the cluster information once a match was found, but there is a possibility that later in the processing the cluster could be "lowered".
     // - 2 or more modules from unrelated clusters we cannot easily decide, most likely should be in common denominator cluster but our cluster2depClusters map is not transitive, only lists direct dependencies
-    static void assignClustersToBundles( List<BundleTuple> bundles, Set<String> wrappedBundleCNBs, Map<String, Set<String>> clusterDependencies, Map<String, Set<String>> cluster2depClusters, Log log )
+    static void assignClustersToBundles( List<BundleTuple> bundles, Set<String> wrappedBundleCNBs,
+                                         Map<String, Set<String>> clusterDependencies,
+                                         Map<String, Set<String>> cluster2depClusters, Log log )
     {
         List<BundleTuple> toProcess = new ArrayList<>();
         List<BundleTuple> known = new ArrayList<>();
@@ -1124,7 +1151,7 @@
             {
                 // we already have this one as a wrapped module.
                 log.debug( "Not including bundle " + art.getDependencyConflictId()
-                                    + ". It is already included in a NetBeans module" );
+                        + ". It is already included in a NetBeans module" );
                 it.remove();
                 continue;
             }
@@ -1138,7 +1165,7 @@
             {
                 toProcess.add( ent );
             }
-            else 
+            else
             {
                 //more results.. from 2 dependent clusters pick the one that is lower in the stack.
                 for ( Iterator<String> it2 = depclusters.iterator(); it2.hasNext(); )
@@ -1163,7 +1190,7 @@
                     }
                 }
                 ent.cluster = depclusters.get( 0 ); //TODO still some free room there, what if they don't directly depend on each other but still are related
-                known.add ( ent );
+                known.add( ent );
             }
         }
         if ( !toProcess.isEmpty() )
@@ -1185,7 +1212,8 @@
             boolean found = false;
             for ( BundleTuple knownBT : known )
             {
-                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiExports() , knownBT.manifest.getOsgiImports() );
+                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiExports(), knownBT.manifest.
+                                                             getOsgiImports() );
                 if ( !is.isEmpty() )
                 {
                     found = true;
@@ -1193,14 +1221,15 @@
                     break;
                 }
                 //dependencyTokens are requireBundle - matches the module property
-                is = Sets.intersection( Collections.singleton( bundleTuple.manifest.getModule() ), new HashSet( knownBT.manifest.getDependencyTokens() ) );
+                is = Sets.intersection( Collections.singleton( bundleTuple.manifest.getModule() ), new HashSet(
+                                        knownBT.manifest.getDependencyTokens() ) );
                 if ( !is.isEmpty() )
                 {
                     found = true;
                     bundleTuple.cluster = knownBT.cluster;
                     break;
                 }
-                
+
             }
             if ( found )
             {
@@ -1208,7 +1237,7 @@
                 it.remove();
                 known.add( bundleTuple );
             }
-            
+
         }
         if ( !toProcess.isEmpty() && atLeastOneWasFound )
         {
@@ -1225,7 +1254,8 @@
             boolean found = false;
             for ( BundleTuple knownBT : known )
             {
-                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiImports() , knownBT.manifest.getOsgiExports() );
+                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiImports(), knownBT.manifest.
+                                                             getOsgiExports() );
                 if ( !is.isEmpty() )
                 {
                     found = true;
@@ -1233,14 +1263,15 @@
                     break;
                 }
                 //dependencyTokens are requireBundle - matches the module property
-                is = Sets.intersection( Collections.singleton( knownBT.manifest.getModule() ), new HashSet( bundleTuple.manifest.getDependencyTokens() ) );
+                is = Sets.intersection( Collections.singleton( knownBT.manifest.getModule() ), new HashSet(
+                                        bundleTuple.manifest.getDependencyTokens() ) );
                 if ( !is.isEmpty() )
                 {
                     found = true;
                     bundleTuple.cluster = knownBT.cluster;
                     break;
                 }
-                
+
             }
             if ( found )
             {
@@ -1248,7 +1279,7 @@
                 it.remove();
                 known.add( bundleTuple );
             }
-            
+
         }
         if ( !toProcess.isEmpty() && atLeastOneWasFound )
         {
@@ -1261,7 +1292,8 @@
     }
 
     //static and default for tests..
-    static Map<String, Set<String>> computeClusterOrdering( Map<String, Set<String>> clusterDependencies, Map<String, Set<String>> clusterModules )
+    static Map<String, Set<String>> computeClusterOrdering( Map<String, Set<String>> clusterDependencies,
+                                                            Map<String, Set<String>> clusterModules )
     {
         Map<String, Set<String>> cluster2depClusters = new HashMap<>();
         for ( Map.Entry<String, Set<String>> entry : clusterDependencies.entrySet() )
@@ -1283,9 +1315,10 @@
         }
         return cluster2depClusters;
     }
-    
+
     static class BundleTuple
     {
+
         final Artifact artifact;
         final ExamineManifest manifest;
         String cluster;
@@ -1295,11 +1328,12 @@
             this.artifact = artifact;
             this.manifest = manifest;
         }
-        
+
     }
 
     private static class ClusterTuple
     {
+
         final File location;
         final boolean newer;
 
@@ -1312,35 +1346,38 @@
 
     static String createBundleConfigFile( String cnb, boolean autoload )
     {
-        return
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-+ "<!DOCTYPE module PUBLIC \"-//NetBeans//DTD Module Status 1.0//EN\"\n"
-+ "                        \"http://www.netbeans.org/dtds/module-status-1_0.dtd\">\n"
-+ "<module name=\"" + cnb + "\">\n"
-+ "    <param name=\"autoload\">" + autoload + "</param>\n"
-+ "    <param name=\"eager\">false</param>\n" + ( autoload ? "" : "    <param name=\"enabled\">true</param>\n" )
-+ "    <param name=\"jar\">modules/" + cnb.replace( ".", "-" ) + ".jar</param>\n"
-+ "    <param name=\"reloadable\">false</param>\n"
-+ "</module>\n";
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+                + "<!DOCTYPE module PUBLIC \"-//NetBeans//DTD Module Status 1.0//EN\"\n"
+                + "                        \"http://www.netbeans.org/dtds/module-status-1_0.dtd\">\n"
+                + "<module name=\"" + cnb + "\">\n"
+                + "    <param name=\"autoload\">" + autoload + "</param>\n"
+                + "    <param name=\"eager\">false</param>\n"
+                + ( autoload ? "" : "    <param name=\"enabled\">true</param>\n" )
+                + "    <param name=\"jar\">modules/" + cnb.replace( ".", "-" ) + ".jar</param>\n"
+                + "    <param name=\"reloadable\">false</param>\n"
+                + "</module>\n";
     }
 
     static String createBundleUpdateTracking( String cnb, File moduleArt, File moduleConf, String specVersion )
-        throws FileNotFoundException, IOException
+            throws FileNotFoundException, IOException
     {
 
-        return
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
-+ "<module codename=\"" + cnb + "\">\n"
-+ "    <module_version install_time=\"" + System.currentTimeMillis() + "\" last=\"true\" origin=\"installer\" specification_version=\"" + specVersion + "\">\n"
-+ "        <file crc=\"" + crcForFile( moduleConf ).getValue() + "\" name=\"config/Modules/" + cnb.replace( ".", "-" ) + ".xml\"/>\n"
-+ "        <file crc=\"" + crcForFile( moduleArt ).getValue() + "\" name=\"modules/" + cnb.replace( ".", "-" ) + ".jar\"/>\n"
-+ "    </module_version>\n"
-+ "</module>";
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+                + "<module codename=\"" + cnb + "\">\n"
+                + "    <module_version install_time=\"" + System.currentTimeMillis()
+                + "\" last=\"true\" origin=\"installer\" specification_version=\"" + specVersion + "\">\n"
+                + "        <file crc=\"" + crcForFile( moduleConf ).getValue() + "\" name=\"config/Modules/" + cnb.
+                replace( ".", "-" ) + ".xml\"/>\n"
+                + "        <file crc=\"" + crcForFile( moduleArt ).getValue() + "\" name=\"modules/" + cnb.replace( ".",
+                                                                                                                    "-" )
+                + ".jar\"/>\n"
+                + "    </module_version>\n"
+                + "</module>";
 
     }
 
     static CRC32 crcForFile( File inFile )
-        throws FileNotFoundException, IOException
+            throws FileNotFoundException, IOException
     {
         CRC32 crc = new CRC32();
         try ( InputStream inFileStream = new FileInputStream( inFile ) )
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
index 3903d41..fcacd66 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
@@ -41,8 +41,8 @@
 import org.codehaus.plexus.util.io.InputStreamFacade;
 
 /**
- * Create the NetBeans module clusters from reactor.
- * Semi-deprecated; used only for standalone modules and "suites".
+ * Create the NetBeans module clusters from reactor. Semi-deprecated; used only for standalone modules and "suites".
+ *
  * @author Milos Kleint
  */
 @Mojo( name = "cluster", aggregator = true, requiresDependencyResolution = ResolutionScope.RUNTIME )
@@ -51,18 +51,24 @@
 {
 
     /**
-     * directory where the the NetBeans cluster will be created.
+     * NetBeans module assembly build directory. directory where the the NetBeans jar and nbm file get constructed.
      */
-    @Parameter( defaultValue = "${project.build.directory}/netbeans_clusters", required = true )
+    @Parameter( defaultValue = "${project.build.directory}/nbm", property = "maven.nbm.buildDir" )
     protected File nbmBuildDir;
 
     /**
-     * default cluster value for reactor projects without cluster information,
-     * typically OSGi bundles
-     * @since 3.2
+     * NetBeans module's cluster. Replaces the cluster element in module descriptor.
+     *
      */
-    @Parameter( defaultValue = "extra" )
-    private String defaultCluster;
+    @Parameter( required = true, defaultValue = "extra" )
+    protected String cluster;
+
+    /**
+     * directory where the the NetBeans cluster will be created.
+     */
+    @Parameter( defaultValue = "${project.build.directory}/netbeans_clusters", required = true )
+    protected File clusterBuildDir;
+
     /**
      * If the executed project is a reactor project, this will contains the full list of projects in the reactor.
      */
@@ -70,26 +76,25 @@
     private List<MavenProject> reactorProjects;
 
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         Project antProject = registerNbmAntTasks();
 
-        if ( !nbmBuildDir.exists() )
+        if ( !clusterBuildDir.exists() )
         {
-            nbmBuildDir.mkdirs();
+            clusterBuildDir.mkdirs();
         }
 
         if ( reactorProjects != null && reactorProjects.size() > 0 )
         {
             for ( MavenProject proj : reactorProjects )
             {
-                //TODO how to figure where the the buildDir/nbm directory is
-                File nbmDir = new File( proj.getBasedir(),
-                        "target" + File.separator + "nbm" + File.separator + "netbeans" );
+
+                File nbmDir = new File( nbmBuildDir, "clusters" );
                 if ( nbmDir.exists() )
                 {
                     Copy copyTask = (Copy) antProject.createTask( "copy" );
-                    copyTask.setTodir( nbmBuildDir );
+                    copyTask.setTodir( clusterBuildDir );
                     copyTask.setOverwrite( true );
                     FileSet set = new FileSet();
                     set.setDir( nbmDir );
@@ -111,8 +116,8 @@
                 {
                     if ( "nbm".equals( proj.getPackaging() ) )
                     {
-                        String error =
-                            "The NetBeans binary directory structure for "
+                        String error
+                                = "The NetBeans binary directory structure for "
                                 + proj.getId()
                                 + " is not created yet."
                                 + "\n Please execute 'mvn install nbm:cluster' to build all relevant projects in the reactor.";
@@ -127,20 +132,20 @@
                         if ( !jar.exists() )
                         {
                             getLog().error( "Skipping " + proj.getId()
-                                                + ". Cannot find the main artifact in output directory." );
+                                    + ". Cannot find the main artifact in output directory." );
                             continue;
                         }
                         mnf.setJarFile( jar );
                         mnf.checkFile();
 
-                        File cluster = new File( nbmBuildDir, defaultCluster );
-                        getLog().debug( "Copying " + art.getId() + " to cluster " + defaultCluster );
-                        File modules = new File( cluster, "modules" );
+                        File clusterDir = new File( clusterBuildDir, cluster );
+                        getLog().debug( "Copying " + art.getId() + " to cluster " + cluster );
+                        File modules = new File( clusterDir, "modules" );
                         modules.mkdirs();
-                        File config = new File( cluster, "config" );
+                        File config = new File( clusterDir, "config" );
                         File confModules = new File( config, "Modules" );
                         confModules.mkdirs();
-                        File updateTracting = new File( cluster, "update_tracking" );
+                        File updateTracting = new File( clusterDir, "update_tracking" );
                         updateTracting.mkdirs();
 
                         final String cnb = mnf.getModule();
@@ -155,14 +160,16 @@
                             {
                                 public InputStream getInputStream() throws IOException
                                 {
-                                    return new StringInputStream( CreateClusterAppMojo.createBundleConfigFile( cnb, mnf.isBundleAutoload() ), "UTF-8" );
+                                    return new StringInputStream( CreateClusterAppMojo.createBundleConfigFile( cnb, mnf.
+                                            isBundleAutoload() ), "UTF-8" );
                                 }
                             }, moduleConf );
                             FileUtils.copyStreamToFile( new InputStreamFacade()
                             {
                                 public InputStream getInputStream() throws IOException
                                 {
-                                    return new StringInputStream( CreateClusterAppMojo.createBundleUpdateTracking( cnb, moduleArt, moduleConf, specVer ), "UTF-8" );
+                                    return new StringInputStream( CreateClusterAppMojo.createBundleUpdateTracking( cnb,
+                                            moduleArt, moduleConf, specVer ), "UTF-8" );
                                 }
                             }, new File( updateTracting, cnbDashed + ".xml" ) );
                         }
@@ -175,7 +182,7 @@
                 }
             }
             //in 6.1 the rebuilt modules will be cached if the timestamp is not touched.
-            File[] files = nbmBuildDir.listFiles();
+            File[] files = clusterBuildDir.listFiles();
             for ( int i = 0; i < files.length; i++ )
             {
                 if ( files[i].isDirectory() )
@@ -195,7 +202,7 @@
                     stamp.setLastModified( new Date().getTime() );
                 }
             }
-            getLog().info( "Created NetBeans module cluster(s) at " + nbmBuildDir );
+            getLog().info( "Created NetBeans module cluster(s) at " + clusterBuildDir );
         }
         else
         {
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
index fbc0e50..45fe227 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
@@ -53,7 +53,7 @@
 
 /**
  * Create the NetBeans module artifact (nbm file), part of "nbm" lifecycle/packaging.
- * 
+ *
  *
  * @author Milos Kleint
  */
@@ -84,82 +84,83 @@
     private String keystorealias;
 
     /**
-     * Boolean parameter denoting if creation of NBM file shall be skipped or not.
-     * If skipped, just the expanded directory for cluster is created
+     * Boolean parameter denoting if creation of NBM file shall be skipped or not. If skipped, just the expanded
+     * directory for cluster is created
+     *
      * @since 3.0
      */
     @Parameter( defaultValue = "false", property = "maven.nbm.skip" )
     private boolean skipNbm;
-    
+
     /**
      * if true, upon installing the NBM the platform app/IDE restart is requested. Not necessary in most cases.
+     *
      * @since 3.8
      */
     @Parameter( defaultValue = "false" )
     private boolean requiresRestart;
-    
+
     /**
-     * Get homepage URL of the module. Is accessible from NetBeans
-     * UI upon installation, should point to place with additional
-     * information about the functionality. 
+     * Get homepage URL of the module. Is accessible from NetBeans UI upon installation, should point to place with
+     * additional information about the functionality.
+     *
      * @since 3.8
      */
     @Parameter( defaultValue = "${project.url}" )
     private String homePageUrl;
-    
+
     /**
      * Author of the module. Shown in the Module manager UI.
+     *
      * @since 3.8
      */
     @Parameter( defaultValue = "${project.organization.name}" )
     private String author;
-    
+
     /**
-     * Distribution base URL for the NBM at runtime deployment time.
-     * Note: Usefulness of the parameter is questionable, it doesn't allow for mirrors and
-     * usually when downloading the nbm, one already knows the location anyway.
-     * Please note that the netbeans.org Ant scripts put a dummy url here.
-     * The actual correct value used when constructing update site is
-     * explicitly set there. The general assumption there is that all modules from one update
-     * center come from one base URL. Also see <code>distBase</code> parameter in auto-update mojo.
+     * Distribution base URL for the NBM at runtime deployment time. Note: Usefulness of the parameter is questionable,
+     * it doesn't allow for mirrors and usually when downloading the nbm, one already knows the location anyway. Please
+     * note that the netbeans.org Ant scripts put a dummy url here. The actual correct value used when constructing
+     * update site is explicitly set there. The general assumption there is that all modules from one update center come
+     * from one base URL. Also see <code>distBase</code> parameter in auto-update mojo.
      * <p/>
-     * The value is either a direct http protocol based URL that points to
-     * the location under which nbm file will be located, or
+     * The value is either a direct http protocol based URL that points to the location under which nbm file will be
+     * located, or
      * <p/>
-     * it allows to create an update site based on maven repository content.
-     * The later created autoupdate site document can use this information and
-     * compose the application from one or multiple maven repositories.
+     * it allows to create an update site based on maven repository content. The later created autoupdate site document
+     * can use this information and compose the application from one or multiple maven repositories.
      * <br/>
      * Format: id::layout::url same as in maven-deploy-plugin
      * <br/>
      * with the 'default' and 'legacy' layouts. (maven2 vs maven1 layout)
      * <br/>
-     * If the value doesn't contain :: characters,
-     * it's assumed to be the flat structure and the value is just the URL.
-     * 
+     * If the value doesn't contain :: characters, it's assumed to be the flat structure and the value is just the URL.
+     *
      */
     @Parameter( property = "maven.nbm.distributionURL" )
     private String distributionUrl;
-    
+
     /**
-     * name of the license applicable to the NBM. The value should be equal across modules with the same license. If the user already agreed to the
-     * same license before, he/she won't be asked again to agree and for multiple one installed at the same time, just one license agreement is shown.
-     * When defined, <code>licenseFile</code> needs to be defined as well.
+     * name of the license applicable to the NBM. The value should be equal across modules with the same license. If the
+     * user already agreed to the same license before, he/she won't be asked again to agree and for multiple one
+     * installed at the same time, just one license agreement is shown. When defined, <code>licenseFile</code> needs to
+     * be defined as well.
+     *
      * @since 3.8
      */
     @Parameter
     private String licenseName;
-    
+
     /**
-     * path to the license agreement file that will be shown when installing the module. When defined, <code>licenseName</code> needs to be defined as well.
+     * path to the license agreement file that will be shown when installing the module. When defined,
+     * <code>licenseName</code> needs to be defined as well.
+     *
      * @since 3.8
      */
     @Parameter
     private File licenseFile;
-    
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
-
     /**
      * Contextualized.
      */
@@ -175,11 +176,10 @@
 
     // end of component params custom code folding
     // </editor-fold>
-    
-    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat ( "yyyy/MM/dd" );
+    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( "yyyy/MM/dd" );
 
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         if ( skipNbm )
         {
@@ -195,7 +195,6 @@
         }
         super.execute();
 
-
         // 3. generate nbm
         File nbmFile = new File( nbmBuildDir, finalName + ".nbm" );
         MakeNBM nbmTask = (MakeNBM) antProject.createTask( "makenbm" );
@@ -207,14 +206,16 @@
         if ( !reqRestart && module.isRequiresRestart() )
         {
             reqRestart = module.isRequiresRestart();
-            getLog().warn( "Module descriptor's requiresRestart field is deprecated, use plugin's configuration in pom.xml" );
+            getLog().warn(
+                    "Module descriptor's requiresRestart field is deprecated, use plugin's configuration in pom.xml" );
         }
         nbmTask.setNeedsrestart( Boolean.toString( reqRestart ) );
         String moduleAuthor = author;
         if ( module.getAuthor() != null )
         {
             moduleAuthor = module.getAuthor();
-            getLog().warn( "Module descriptor's requiresRestart field is deprecated, use plugin's configuration in pom.xml" );
+            getLog().warn(
+                    "Module descriptor's requiresRestart field is deprecated, use plugin's configuration in pom.xml" );
         }
         nbmTask.setModuleauthor( moduleAuthor );
         if ( keystore != null && keystorealias != null && keystorepassword != null )
@@ -243,14 +244,16 @@
         if ( module.getLicenseName() != null )
         {
             licName = module.getLicenseName();
-            getLog().warn( "Module descriptor's licenseName field is deprecated, use plugin's configuration in pom.xml" );
+            getLog().
+                    warn( "Module descriptor's licenseName field is deprecated, use plugin's configuration in pom.xml" );
         }
         if ( module.getLicenseFile() != null )
         {
             File lf = new File( project.getBasedir(), module.getLicenseFile() );
             licFile = lf;
-            getLog().warn( "Module descriptor's licenseFile field is deprecated, use plugin's configuration in pom.xml" );
-            
+            getLog().
+                    warn( "Module descriptor's licenseFile field is deprecated, use plugin's configuration in pom.xml" );
+
         }
         if ( licName != null && licFile != null )
         {
@@ -279,7 +282,8 @@
         String hpUrl = homePageUrl;
         if ( module.getHomepageUrl() != null )
         {
-            getLog().warn( "Module descriptor's homePageUrl field is deprecated, use plugin's configuration in pom.xml" );
+            getLog().
+                    warn( "Module descriptor's homePageUrl field is deprecated, use plugin's configuration in pom.xml" );
             hpUrl = module.getHomepageUrl();
         }
         if ( hpUrl != null )
@@ -290,7 +294,8 @@
         if ( module.getDistributionUrl() != null )
         {
             distribUrl = module.getDistributionUrl();
-            getLog().warn( "Module descriptor's distributionUrl field is deprecated, use plugin's configuration in pom.xml" );
+            getLog().warn(
+                    "Module descriptor's distributionUrl field is deprecated, use plugin's configuration in pom.xml" );
         }
         if ( distribUrl != null )
         {
@@ -301,8 +306,8 @@
             {
                 if ( !distribUrl.contains( "::" ) )
                 {
-                    dist =
-                        distribUrl + ( distribUrl.endsWith( "/" ) ? "" : "/" )
+                    dist
+                            = distribUrl + ( distribUrl.endsWith( "/" ) ? "" : "/" )
                             + nbmFile.getName();
                 }
             }
@@ -312,8 +317,8 @@
                         project.getGroupId(), project.getArtifactId(),
                         project.getVersion(), null, "nbm-file" );
 
-                dist =
-                    distRepository.getUrl() + ( distRepository.getUrl().endsWith( "/" ) ? "" : "/" )
+                dist
+                        = distRepository.getUrl() + ( distRepository.getUrl().endsWith( "/" ) ? "" : "/" )
                         + distRepository.pathOf( art );
 
             }
@@ -323,7 +328,7 @@
         {
             nbmTask.setDistribution( nbmFile.getName() );
         }
-        if ( ! "extra".equals( cluster ) )
+        if ( !"extra".equals( cluster ) )
         {
             nbmTask.setTargetcluster( cluster );
         }
@@ -373,7 +378,7 @@
                 String devsString = "";
                 while ( dvs.hasNext() )
                 {
-                    Developer d = ( Developer ) dvs.next();
+                    Developer d = (Developer) dvs.next();
                     devsString = devsString + "," + d.getName() != null ? d.getName() : d.getId();
                 }
                 organization = devsString.substring( 1 );
@@ -395,22 +400,22 @@
         }
         return "Copyright " + organization + " " + date;
     }
-    
+
     private String createDefaultLicenseText()
     {
         String toRet = "License terms:\n";
-        
+
         List licenses = project.getLicenses();
         if ( licenses != null && licenses.size() > 0 )
         {
             Iterator lic = licenses.iterator();
             while ( lic.hasNext() )
             {
-                License ll = ( License ) lic.next();
-                
+                License ll = (License) lic.next();
+
                 if ( ll.getName() != null )
                 {
-                   toRet = toRet + ll.getName() + " - "; 
+                    toRet = toRet + ll.getName() + " - ";
                 }
                 if ( ll.getUrl() != null )
                 {
@@ -424,7 +429,7 @@
         }
         else
         {
-           toRet = toRet + "Unknown";
+            toRet = toRet + "Unknown";
         }
         return toRet;
     }
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java b/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java
index c99323b..a178ee9 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java
@@ -74,7 +74,7 @@
 
 /**
  * Create the NetBeans module directory structure, a prerequisite for nbm creation and cluster creation.
- * 
+ *
  *
  * @author Milos Kleint
  *
@@ -84,8 +84,7 @@
 {
 
     /**
-     * NetBeans module assembly build directory.
-     * directory where the the NetBeans jar and nbm file get constructed.
+     * NetBeans module assembly build directory. directory where the the NetBeans jar and nbm file get constructed.
      */
     @Parameter( defaultValue = "${project.build.directory}/nbm", property = "maven.nbm.buildDir" )
     protected File nbmBuildDir;
@@ -101,7 +100,9 @@
     protected String finalName;
     /**
      * a NetBeans module descriptor containing dependency information and more..
-     * @deprecated all content from the module descriptor can be defined as plugin configuration now, will be removed in 4.0 entirely
+     *
+     * @deprecated all content from the module descriptor can be defined as plugin configuration now, will be removed in
+     * 4.0 entirely
      */
     @Parameter( defaultValue = "${basedir}/src/main/nbm/module.xml" )
     protected File descriptor;
@@ -112,10 +113,10 @@
     @Parameter( required = true, defaultValue = "extra" )
     protected String cluster;
     /**
-     * The location of JavaHelp sources for the project. The documentation
-     * itself is expected to be in the directory structure based on codenamebase of the module.
-     * eg. if your codenamebase is "org.netbeans.modules.apisupport", then the actual docs
-     * files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs.
+     * The location of JavaHelp sources for the project. The documentation itself is expected to be in the directory
+     * structure based on codenamebase of the module. eg. if your codenamebase is "org.netbeans.modules.apisupport",
+     * then the actual docs files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs.
+     *
      * @deprecated Obsolete as of NetBeans 7.0 with &#64;HelpSetRegistration.
      * @since 2.7
      */
@@ -127,21 +128,22 @@
     protected MavenProject project;
 
     /**
-     * A list of additional resources to include in the NBM file.
-     * (Not in the module JAR; see <code>InstalledFileLocator</code> for retrieval.)
-     * Supersedes similarly-named configuration in the module descriptor file.
-     * <p>For example, to include native libraries:</p>
+     * A list of additional resources to include in the NBM file. (Not in the module JAR; see
+     * <code>InstalledFileLocator</code> for retrieval.) Supersedes similarly-named configuration in the module
+     * descriptor file.
+     * <p>
+     * For example, to include native libraries:</p>
      *
-     <pre>
-            &lt;nbmResource&gt;
-            &nbsp;&nbsp;&lt;directory&gt;src/main/libs&lt;/directory&gt;
-            &nbsp;&nbsp;&lt;targetPath&gt;modules/lib&lt;/targetPath&gt;
-            &nbsp;&nbsp;&lt;includes&gt;
-            &nbsp;&nbsp;&nbsp;&nbsp;&lt;include&gt;*.dll&lt;/include&gt;
-            &nbsp;&nbsp;&nbsp;&nbsp;&lt;include&gt;*.so&lt;/include&gt;
-            &nbsp;&nbsp;&lt;/includes&gt;
-            &lt;/nbmResource&gt;
-     </pre>
+     * <pre>
+     * &lt;nbmResource&gt;
+     * &nbsp;&nbsp;&lt;directory&gt;src/main/libs&lt;/directory&gt;
+     * &nbsp;&nbsp;&lt;targetPath&gt;modules/lib&lt;/targetPath&gt;
+     * &nbsp;&nbsp;&lt;includes&gt;
+     * &nbsp;&nbsp;&nbsp;&nbsp;&lt;include&gt;*.dll&lt;/include&gt;
+     * &nbsp;&nbsp;&nbsp;&nbsp;&lt;include&gt;*.so&lt;/include&gt;
+     * &nbsp;&nbsp;&lt;/includes&gt;
+     * &lt;/nbmResource&gt;
+     * </pre>
      *
      * @since 3.2
      */
@@ -154,64 +156,69 @@
      * @since 3.2
      */
     @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
-    
+
     protected String encoding;
-    
+
     /**
      * Deployment type of the module, allowed values are <code>normal</code>,<code>eager</code>,<code>autoload</code>,
      * <code>disabled</code>.
      * <p>
-     * <code>autoload</code> - Such a module is
-     * automatically enabled when some other module requires it and
+     * <code>autoload</code> - Such a module is automatically enabled when some other module requires it and
      * automatically disabled otherwise.</p>
-     *                     <p><code>eager</code> - This module type gets
-     * automatically enabled when all it's dependencies are
-     * satisfied. Disabled otherwise.</p>
-     *                     <p><code>normal</code> - This is the default
-     * value. This kind of module is enabled/disabled manually by
-     * the user. It installs enabled.</p>
-     *                     <p><code>disabled</code> - This kind of module is enabled/disabled manually by
-     * the user. It installs disabled. Since 3.11</p>
+     * <p>
+     * <code>eager</code> - This module type gets automatically enabled when all it's dependencies are satisfied.
+     * Disabled otherwise.</p>
+     * <p>
+     * <code>normal</code> - This is the default value. This kind of module is enabled/disabled manually by the user. It
+     * installs enabled.</p>
+     * <p>
+     * <code>disabled</code> - This kind of module is enabled/disabled manually by the user. It installs disabled. Since
+     * 3.11</p>
      *
-     * For details, see <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#enablement">Netbeans Module system docs</a>
+     * For details, see
+     * <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#enablement">Netbeans
+     * Module system docs</a>
      *
-     * Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to false, if not defined already otherwise in the manifest.
-     * See issue <a href="http://jira.codehaus.org/browse/MNBMODULE-194">MNBMODULE-194</a>
+     * Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to
+     * false, if not defined already otherwise in the manifest. See issue
+     * <a href="http://jira.codehaus.org/browse/MNBMODULE-194">MNBMODULE-194</a>
      *
-     * 
+     *
      * @since 3.8
-     */ 
+     */
     @Parameter( defaultValue = "normal" )
     protected String moduleType;
-    
+
     /**
-     * codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package name equivalent.
-     * Can include the major release version.
-     * See <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-manifest"> NetBeans Module system docs</a>
+     * codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package
+     * name equivalent. Can include the major release version. See
+     * <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-manifest">
+     * NetBeans Module system docs</a>
+     *
      * @since 3.8
      */
     @Parameter( defaultValue = "${project.groupId}.${project.artifactId}" )
     private String codeNameBase;
-    
+
     /**
-     * list of groupId:artifactId pairs describing libraries that go into the nbm file and will only include the .external reference in the nbm
-     * instead of the actual binary. See <a href="http://netbeans.org/bugzilla/show_bug.cgi?id=195041">NetBeans issue #195041</a> for details.
-     * Please note that the scheme will only work for artifacts present in central repository but no effort is made at build time to enforce that.
-     * Additionally at runtime when installing the module, the user has to be online and be capable of reaching central using maven. 
-     * You have been warned.
+     * list of groupId:artifactId pairs describing libraries that go into the nbm file and will only include the
+     * .external reference in the nbm instead of the actual binary. See
+     * <a href="http://netbeans.org/bugzilla/show_bug.cgi?id=195041">NetBeans issue #195041</a> for details. Please note
+     * that the scheme will only work for artifacts present in central repository but no effort is made at build time to
+     * enforce that. Additionally at runtime when installing the module, the user has to be online and be capable of
+     * reaching central using maven. You have been warned.
+     *
      * @since 3.8
-     */ 
+     */
     @Parameter
     private List<String> externals;
 
-
     @Component
     protected MavenResourcesFiltering mavenResourcesFiltering;
 
     @Parameter( property = "session", readonly = true, required = true )
     protected MavenSession session;
 
-
     //items used by the CreateNBMMojo.
     protected Project antProject;
     protected NetBeansModule module;
@@ -238,7 +245,8 @@
             type = module.getModuleType();
             getLog().warn( "moduleType in module descriptor is deprecated, use the plugin's parameter moduleType" );
         }
-        if ( !"normal".equals( type ) && !"autoload".equals( type ) && !"eager".equals( type ) && !"disabled".equals( type ) )
+        if ( !"normal".equals( type ) && !"autoload".equals( type ) && !"eager".equals( type ) && !"disabled".equals(
+                type ) )
         {
             getLog().error( "Only 'normal,autoload,eager,disabled' are allowed values in the moduleType parameter" );
         }
@@ -261,7 +269,7 @@
             cluster = module.getCluster();
         }
         File jarFile = new File( buildDir, finalName + ".jar" );
-        clusterDir = new File( nbmBuildDir, "netbeans" + File.separator + cluster );
+        clusterDir = new File( nbmBuildDir, "clusters" + File.separator + cluster );
         File moduleJarLocation = new File( clusterDir, "modules" );
         moduleJarLocation.mkdirs();
 
@@ -277,7 +285,7 @@
                 JarInputStream jis = new JarInputStream( is );
                 Manifest m = jis.getManifest();
                 Attributes a = m.getMainAttributes();
-                String classPath = ( String ) a.remove( new Attributes.Name( "X-Class-Path" ) );
+                String classPath = (String) a.remove( new Attributes.Name( "X-Class-Path" ) );
                 if ( classPath == null )
                 {
                     needPlainCopy = true;
@@ -340,9 +348,9 @@
             for ( Artifact artifact : artifacts )
             {
                 File source = artifact.getFile();
-                
+
                 String path = NetBeansManifestUpdateMojo.artifactToClassPathEntry( artifact, codeNameBase );
-                
+
                 if ( classpathValue.contains( path ) )
                 {
                     File target = new File( moduleJarLocation, path );
@@ -353,7 +361,8 @@
                     try
                     {
                         FileUtils.getFileUtils().copyFile( source, target, null, true, false );
-                        if ( externals != null && externals.contains( artifact.getGroupId() + ":" + artifact.getArtifactId() ) ) // MNBMODULE-138
+                        if ( externals != null && externals.contains( artifact.getGroupId() + ":" + artifact.
+                                getArtifactId() ) ) // MNBMODULE-138
                         {
                             String name = target.getName();
                             getLog().info( "Using *.external replacement for " + name );
@@ -481,13 +490,14 @@
     }
 
     private void copyDeprecatedNbmResources()
-        throws BuildException, MojoExecutionException
+            throws BuildException, MojoExecutionException
     {
         // copy additional resources..
         List<NbmResource> ress = module.getNbmResources();
         if ( ress.size() > 0 )
         {
-            getLog().warn( "NBM resources defined in module descriptor are deprecated. Please configure NBM resources in plugin configuration." );
+            getLog().warn(
+                    "NBM resources defined in module descriptor are deprecated. Please configure NBM resources in plugin configuration." );
             Copy cp = (Copy) antProject.createTask( "copy" );
             cp.setTodir( clusterDir );
             HashMap<File, Collection<FileSet>> customPaths = new HashMap<File, Collection<FileSet>>();
@@ -602,18 +612,18 @@
     }
 
     private void copyNbmResources()
-        throws MojoExecutionException
+            throws MojoExecutionException
     {
         try
         {
             if ( StringUtils.isEmpty( encoding ) && isFilteringEnabled( nbmResources ) )
             {
                 getLog().warn( "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
-                                   + ", i.e. build is platform dependent!" );
+                        + ", i.e. build is platform dependent!" );
             }
-            MavenResourcesExecution mavenResourcesExecution =
-                new MavenResourcesExecution( Arrays.asList( nbmResources ), clusterDir, project, encoding,
-                                             Collections.EMPTY_LIST, Collections.EMPTY_LIST, session );
+            MavenResourcesExecution mavenResourcesExecution
+                    = new MavenResourcesExecution( Arrays.asList( nbmResources ), clusterDir, project, encoding,
+                            Collections.EMPTY_LIST, Collections.EMPTY_LIST, session );
             mavenResourcesExecution.setEscapeWindowsPaths( true );
             mavenResourcesFiltering.filterResources( mavenResourcesExecution );
         }
@@ -642,7 +652,7 @@
     }
 
     static void writeExternal( PrintWriter w, Artifact artifact )
-        throws IOException
+            throws IOException
     {
         w.write( "CRC:" );
         File file = artifact.getFile();
@@ -664,7 +674,9 @@
         }
         w.write( "\nURL:" );
         // artifact.repository is null, so cannot use its url, and anyway might be a mirror
-        w.write( /* M3: RepositorySystem.DEFAULT_REMOTE_REPO_URL + '/' */ "http://repo.maven.apache.org/maven2/" );
+        w.
+                write( /* M3: RepositorySystem.DEFAULT_REMOTE_REPO_URL + '/' */
+                        "http://repo.maven.apache.org/maven2/" );
         w.write( new DefaultRepositoryLayout().pathOf( artifact ) );
         w.write( '\n' );
         w.flush();
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
index 4d66894..707e149 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
@@ -62,13 +62,13 @@
     private MavenProject project;
 
     /**
-     * 
+     *
      * @throws MojoExecutionException if an unexpected problem occurs
      * @throws MojoFailureException if an expected problem occurs
      */
     @Override
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
 
         try
@@ -78,17 +78,19 @@
             ZipArchiver archiver = new ZipArchiver();
             DefaultFileSet fs = new DefaultFileSet();
             fs.setDirectory( outputDirectory );
-            fs.setIncludes( new String[] {
+            fs.setIncludes( new String[]
+            {
                 brandingToken + "/**",
             } );
-            fs.setExcludes( new String[] {
+            fs.setExcludes( new String[]
+            {
                 brandingToken + "/bin/*",
             } );
             archiver.addFileSet( fs );
             File bins = new File( nbmBuildDirFile, "bin" );
             for ( File bin : bins.listFiles() )
             {
-                archiver.addFile( bin, brandingToken + "/bin/" + bin.getName(), 0755 );
+                archiver.addFile( bin, brandingToken + "/bin/" + bin.getName(), EXEC_FILE_MOD );
             }
             File zipFile = new File( outputDirectory, finalName + ".zip" );
             //TODO - somehow check for last modified content to see if we shall be
@@ -105,4 +107,5 @@
         }
 
     }
+    private static final int EXEC_FILE_MOD = 0755;
 }
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
index d6901bf..ced107e 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
@@ -56,12 +56,13 @@
 
 /**
  * Create the NetBeans auto update site definition.
+ *
  * @author Milos Kleint
  *
  */
-@Mojo( name = "autoupdate", 
-        defaultPhase = LifecyclePhase.PACKAGE, 
-        aggregator = true, 
+@Mojo( name = "autoupdate",
+        defaultPhase = LifecyclePhase.PACKAGE,
+        aggregator = true,
         requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class CreateUpdateSiteMojo
         extends AbstractNbmMojo
@@ -79,25 +80,23 @@
     @Parameter( defaultValue = "updates.xml", property = "maven.nbm.updatesitexml" )
     protected String fileName;
     /**
-     * A custom distribution base for the nbms in the update site.
-     * If NOT defined, the update site will use a simple relative URL, which is generally what you want.
-     * Defining it as "auto" will pick up the distribution URL from each NBM, which is generally wrong. 
-     * See <code>distributionUrl</code> in nbm mojo for what url will be used in that case.
+     * A custom distribution base for the nbms in the update site. If NOT defined, the update site will use a simple
+     * relative URL, which is generally what you want. Defining it as "auto" will pick up the distribution URL from each
+     * NBM, which is generally wrong. See <code>distributionUrl</code> in nbm mojo for what url will be used in that
+     * case.
      * <p/>
-     * The value is either a direct http protocol based URL that points to
-     * the location under which all nbm files are located, or
+     * The value is either a direct http protocol based URL that points to the location under which all nbm files are
+     * located, or
      * <p/>
-     * allows to create an update site based on maven repository content.
-     * The resulting autoupdate site document can be uploaded as tar.gz to repository as well
-     * as attached artifact to the 'nbm-application' project.
+     * allows to create an update site based on maven repository content. The resulting autoupdate site document can be
+     * uploaded as tar.gz to repository as well as attached artifact to the 'nbm-application' project.
      * <br/>
      * Format: id::layout::url same as in maven-deploy-plugin
      * <br/>
      * with the 'default' and 'legacy' layouts. (maven2 vs maven1 layout)
      * <br/>
-     * If the value doesn't contain :: characters,
-     * it's assumed to be the flat structure and the value is just the URL.
-     * 
+     * If the value doesn't contain :: characters, it's assumed to be the flat structure and the value is just the URL.
+     *
      * @since 3.0 it's also possible to add remote repository as base
      */
     @Parameter( defaultValue = ".", property = "maven.nbm.customDistBase" )
@@ -115,19 +114,18 @@
      */
     @Parameter( required = true, readonly = true, defaultValue = "${reactorProjects}" )
     private List reactorProjects;
-    
+
     /**
-     * List of Ant style patterns on artifact GA (groupID:artifactID) that should be included in the update site.
-     * Eg. org.netbeans.* matches all artifacts with any groupID starting with 'org.netbeans.',
-     * org.*:api will match any artifact with artifactId of 'api' and groupId starting with 'org.'
+     * List of Ant style patterns on artifact GA (groupID:artifactID) that should be included in the update site. Eg.
+     * org.netbeans.* matches all artifacts with any groupID starting with 'org.netbeans.', org.*:api will match any
+     * artifact with artifactId of 'api' and groupId starting with 'org.'
+     *
      * @since 3.14
      */
     @Parameter
     private List<String> updateSiteIncludes;
-    
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
-
     @Component
     private ArtifactFactory artifactFactory;
     /**
@@ -152,9 +150,8 @@
     protected ArtifactRepository localRepository;
 
     // </editor-fold>
-
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         Project antProject = registerNbmAntTasks();
         File nbmBuildDirFile = new File( outputDirectory, "netbeans_site" );
@@ -192,8 +189,8 @@
                 {
                     continue;
                 }
-                ArtifactResult res =
-                    turnJarToNbmFile( art, artifactFactory, artifactResolver, project, localRepository );
+                ArtifactResult res
+                        = turnJarToNbmFile( art, artifactFactory, artifactResolver, project, localRepository );
                 if ( res.hasConvertedArtifact() )
                 {
                     art = res.getConvertedArtifact();
@@ -274,9 +271,10 @@
                         {
                             continue;
                         }
-                        Artifact art =
-                            artifactFactory.createArtifact( proj.getGroupId(), proj.getArtifactId(), proj.getVersion(),
-                                                            null, "nbm-file" );
+                        Artifact art
+                                = artifactFactory.createArtifact( proj.getGroupId(), proj.getArtifactId(), proj.
+                                        getVersion(),
+                                        null, "nbm-file" );
                         String path = distRepository.pathOf( art );
                         File f = new File( nbmBuildDirFile, path.replace( '/', File.separatorChar ) );
                         copyTask.setTofile( f );
@@ -345,7 +343,7 @@
     private static final Pattern ALT_REPO_SYNTAX_PATTERN = Pattern.compile( "(.+)::(.+)::(.+)" );
 
     static ArtifactRepository getDeploymentRepository( String distBase, PlexusContainer container, Log log )
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
 
         ArtifactRepository repo = null;
@@ -390,7 +388,7 @@
 
     @Override
     public void contextualize( Context context )
-        throws ContextException
+            throws ContextException
     {
         this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
@@ -410,7 +408,7 @@
                     return true;
                 }
             }
-            return false;    
+            return false;
         }
         return true;
     }
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java
index e3e3cd4..2fa3cb9 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java
@@ -63,18 +63,19 @@
 
 /**
  * Create webstartable binaries for a 'nbm-application'.
+ *
  * @author Johan Andrén
  * @author Milos Kleint
  * @since 3.0
  */
 @Mojo( name = "webstart-app", defaultPhase = LifecyclePhase.PACKAGE )
 public class CreateWebstartAppMojo
-    extends AbstractNbmMojo
+        extends AbstractNbmMojo
 {
 
     /**
      * The Maven project.
-
+     *
      */
     @org.apache.maven.plugins.annotations.Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
@@ -96,13 +97,15 @@
 
     /**
      * Ready-to-deploy WAR containing application in JNLP packaging.
-     * 
+     *
      */
-    @org.apache.maven.plugins.annotations.Parameter( required = true, defaultValue = "${project.build.directory}/${project.artifactId}-${project.version}-jnlp.war" )
+    @org.apache.maven.plugins.annotations.Parameter( required = true, defaultValue
+            = "${project.build.directory}/${project.artifactId}-${project.version}-jnlp.war" )
     private File destinationFile;
 
     /**
      * Artifact Classifier to use for the webstart distributable zip file.
+     *
      * @since 3.1
      */
     @org.apache.maven.plugins.annotations.Parameter( defaultValue = "webstart", property = "nbm.webstart.classifier" )
@@ -116,10 +119,9 @@
     private String codebase;
 
     /**
-     * A custom master JNLP file. If not defined, the 
-     * <a href="http://mojo.codehaus.org/nbm-maven-plugin/masterjnlp.txt">default one</a> is used.
-     * The following expressions can be used within the file and will
-     * be replaced when generating content.
+     * A custom master JNLP file. If not defined, the
+     * <a href="http://mojo.codehaus.org/nbm-maven-plugin/masterjnlp.txt">default one</a> is used. The following
+     * expressions can be used within the file and will be replaced when generating content.
      * <ul>
      * <li>${jnlp.resources}</li>
      * <li>${jnlp.codebase} - the 'codebase' parameter value is passed in.</li>
@@ -133,11 +135,11 @@
      */
     @org.apache.maven.plugins.annotations.Parameter
     private File masterJnlpFile;
-    
+
     /**
-     * The basename (minus .jnlp extension) of the master JNLP file in the output.
-     * This file will be the entry point for javaws.
-     * Defaults to the branding token.
+     * The basename (minus .jnlp extension) of the master JNLP file in the output. This file will be the entry point for
+     * javaws. Defaults to the branding token.
+     *
      * @since 3.5
      */
     @org.apache.maven.plugins.annotations.Parameter( property = "master.jnlp.file.name" )
@@ -163,47 +165,46 @@
 
     /**
      * keystore type
+     *
      * @since 3.5
      */
     @org.apache.maven.plugins.annotations.Parameter( property = "keystoretype" )
     private String keystoretype;
 
     /**
-     * If set true, build-jnlp target creates versioning info in jnlp descriptors and version.xml files.
-     * This allows for incremental updates of Webstart applications, but requires download via
-     * JnlpDownloadServlet
-     * Defaults to false, which means versioning
-     * info is not generated (see
+     * If set true, build-jnlp target creates versioning info in jnlp descriptors and version.xml files. This allows for
+     * incremental updates of Webstart applications, but requires download via JnlpDownloadServlet Defaults to false,
+     * which means versioning info is not generated (see
      * http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html#resources).
      *
      */
     @org.apache.maven.plugins.annotations.Parameter( defaultValue = "false", property = "nbm.webstart.versions" )
     private boolean processJarVersions;
     /**
-     * additional command line arguments. Eg.
-     * -J-Xdebug -J-Xnoagent -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=8888
-     * can be used to debug the IDE.
+     * additional command line arguments. Eg. -J-Xdebug -J-Xnoagent
+     * -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=8888 can be used to debug the IDE.
      */
     @org.apache.maven.plugins.annotations.Parameter( property = "netbeans.run.params" )
     private String additionalArguments;
 
     /**
-     * 
+     *
      * @throws MojoExecutionException if an unexpected problem occurs
      * @throws MojoFailureException if an expected problem occurs
      */
     @Override
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         if ( !"nbm-application".equals( project.getPackaging() ) )
         {
             throw new MojoExecutionException(
-                "This goal only makes sense on project with nbm-application packaging." );
+                    "This goal only makes sense on project with nbm-application packaging." );
         }
         Project antProject = antProject();
-        
-        getLog().warn( "WARNING: Unsigned and self-signed WebStart applications are deprecated from JDK7u21 onwards. To ensure future correct functionality please use trusted certificate." );
+
+        getLog().warn(
+                "WARNING: Unsigned and self-signed WebStart applications are deprecated from JDK7u21 onwards. To ensure future correct functionality please use trusted certificate." );
 
         if ( keystore != null && keystorealias != null && keystorepassword != null )
         {
@@ -220,12 +221,12 @@
         else if ( keystore != null || keystorepassword != null || keystorealias != null )
         {
             throw new MojoFailureException(
-                "If you want to sign the jnlp application, you need to define all three keystore related parameters." );
+                    "If you want to sign the jnlp application, you need to define all three keystore related parameters." );
         }
         else
         {
             File generatedKeystore = new File( outputDirectory, "generated.keystore" );
-            if ( ! generatedKeystore.exists() )
+            if ( !generatedKeystore.exists() )
             {
                 getLog().warn( "Keystore related parameters not set, generating a default keystore." );
                 GenerateKey genTask = (GenerateKey) antProject.createTask( "genkey" );
@@ -250,11 +251,10 @@
         taskdef.setName( "verifyjnlp" );
         taskdef.execute();
 
-
         try
         {
             File webstartBuildDir = new File(
-                outputDirectory + File.separator + "webstart" + File.separator + brandingToken );
+                    outputDirectory + File.separator + "webstart" + File.separator + brandingToken );
             if ( webstartBuildDir.exists() )
             {
                 FileUtils.deleteDirectory( webstartBuildDir );
@@ -266,7 +266,6 @@
             File nbmBuildDirFile = new File( outputDirectory, brandingToken );
 
 //            FileUtils.copyDirectoryStructureIfModified( nbmBuildDirFile, webstartBuildDir );
-
             MakeJNLP jnlpTask = (MakeJNLP) antProject.createTask( "makejnlp" );
             jnlpTask.setDir( webstartBuildDir );
             jnlpTask.setCodebase( localCodebase );
@@ -309,11 +308,11 @@
             exModules.setName( "excludeModules" );
             exModules.setValue( "" );
             ms.setParameters( new Parameter[]
-                {
-                    included,
-                    excluded,
-                    exModules
-                } );
+            {
+                included,
+                excluded,
+                exModules
+            } );
             and.add( or );
             and.add( ms );
             fs.addAnd( and );
@@ -324,7 +323,7 @@
 
             if ( masterJnlpFileName == null )
             {
-               masterJnlpFileName = brandingToken;
+                masterJnlpFileName = brandingToken;
             }
 
             Properties props = new Properties();
@@ -365,13 +364,12 @@
             props.setProperty( "netbeans.run.params", stBuilder.toString() );
 
             File masterJnlp = new File(
-                webstartBuildDir.getAbsolutePath() + File.separator + masterJnlpFileName + ".jnlp" );
+                    webstartBuildDir.getAbsolutePath() + File.separator + masterJnlpFileName + ".jnlp" );
             filterCopy( masterJnlpFile, "master.jnlp", masterJnlp, props );
 
-
             File startup = copyLauncher( outputDirectory, nbmBuildDirFile );
             File jnlpDestination = new File(
-                webstartBuildDir.getAbsolutePath() + File.separator + "startup.jar" );
+                    webstartBuildDir.getAbsolutePath() + File.separator + "startup.jar" );
 
             SignJar signTask = (SignJar) antProject.createTask( "signjar" );
             signTask.setKeystore( keystore );
@@ -389,9 +387,9 @@
             DirectoryScanner ds = new DirectoryScanner();
             ds.setBasedir( nbmBuildDirFile );
             ds.setIncludes( new String[]
-                {
-                    "**/locale/*.jar"
-                } );
+            {
+                "**/locale/*.jar"
+            } );
             ds.scan();
             String[] includes = ds.getIncludedFiles();
             StringBuilder brandRefs = new StringBuilder();
@@ -415,7 +413,7 @@
                 {
                     signTask.setStoretype( keystoretype );
                 }
-                
+
                 FileSet set = new FileSet();
                 set.setDir( brandingDir );
                 set.setIncludes( "*.jar" );
@@ -424,10 +422,10 @@
             }
 
             File modulesJnlp = new File(
-                webstartBuildDir.getAbsolutePath() + File.separator + "modules.jnlp" );
+                    webstartBuildDir.getAbsolutePath() + File.separator + "modules.jnlp" );
             props.setProperty( "jnlp.branding.jars", brandRefs.toString() );
             props.setProperty( "jnlp.resources", extSnippet );
-            filterCopy( null, /* filename is historical */"branding.jnlp", modulesJnlp, props );
+            filterCopy( null, /* filename is historical */ "branding.jnlp", modulesJnlp, props );
 
             getLog().info( "Verifying generated webstartable content." );
             VerifyJNLP verifyTask = (VerifyJNLP) antProject.createTask( "verifyjnlp" );
@@ -436,7 +434,6 @@
             verifyTask.addConfiguredFileset( verify );
             verifyTask.execute();
 
-
             // create zip archive
             if ( destinationFile.exists() )
             {
@@ -450,7 +447,10 @@
             }
             else
             {
-                archiver.addDirectory( webstartBuildDir, null, new String[] { "**/*.jnlp" } );
+                archiver.addDirectory( webstartBuildDir, null, new String[]
+                {
+                    "**/*.jnlp"
+                } );
                 for ( final File jnlp : webstartBuildDir.listFiles() )
                 {
                     if ( !jnlp.getName().endsWith( ".jnlp" ) )
@@ -459,35 +459,51 @@
                     }
                     archiver.addResource( new PlexusIoResource()
                     {
-                        public @Override InputStream getContents() throws IOException
+                        public @Override
+                        InputStream getContents() throws IOException
                         {
-                            return new ByteArrayInputStream( FileUtils.fileRead( jnlp, "UTF-8" ).replace( localCodebase, "$$codebase" ).getBytes( "UTF-8" ) );
+                            return new ByteArrayInputStream( FileUtils.fileRead( jnlp, "UTF-8" ).replace( localCodebase,
+                                    "$$codebase" ).getBytes( "UTF-8" ) );
                         }
-                        public @Override long getLastModified()
+
+                        public @Override
+                        long getLastModified()
                         {
                             return jnlp.lastModified();
                         }
-                        public @Override boolean isExisting()
+
+                        public @Override
+                        boolean isExisting()
                         {
                             return true;
                         }
-                        public @Override long getSize()
+
+                        public @Override
+                        long getSize()
                         {
                             return UNKNOWN_RESOURCE_SIZE;
                         }
-                        public @Override URL getURL() throws IOException
+
+                        public @Override
+                        URL getURL() throws IOException
                         {
                             return null;
                         }
-                        public @Override String getName()
+
+                        public @Override
+                        String getName()
                         {
                             return jnlp.getAbsolutePath();
                         }
-                        public @Override boolean isFile()
+
+                        public @Override
+                        boolean isFile()
                         {
                             return true;
                         }
-                        public @Override boolean isDirectory()
+
+                        public @Override
+                        boolean isDirectory()
                         {
                             return false;
                         }
@@ -502,7 +518,7 @@
             }
             File jdkhome = new File( System.getProperty( "java.home" ) );
             File servlet = new File( jdkhome, "sample/jnlp/servlet/jnlp-servlet.jar" );
-            if ( ! servlet.isFile() )
+            if ( !servlet.isFile() )
             {
                 servlet = new File( jdkhome.getParentFile(), "sample/jnlp/servlet/jnlp-servlet.jar" );
             }
@@ -511,45 +527,60 @@
                 archiver.addFile( servlet, "WEB-INF/lib/jnlp-servlet.jar" );
                 archiver.addResource( new PlexusIoResource()
                 {
-                    public @Override InputStream getContents() throws IOException
+                    public @Override
+                    InputStream getContents() throws IOException
                     {
-                        return new ByteArrayInputStream( ( "" 
-                            + "<web-app>\n"
-                            + "    <servlet>\n"
-                            + "        <servlet-name>JnlpDownloadServlet</servlet-name>\n"
-                            + "        <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>\n"
-                            + "    </servlet>\n"
-                            + "    <servlet-mapping>\n"
-                            + "        <servlet-name>JnlpDownloadServlet</servlet-name>\n"
-                            + "        <url-pattern>*.jnlp</url-pattern>\n"
-                            + "    </servlet-mapping>\n"
-                            + "</web-app>\n" ).getBytes() );
+                        return new ByteArrayInputStream( ( ""
+                                + "<web-app>\n"
+                                + "    <servlet>\n"
+                                + "        <servlet-name>JnlpDownloadServlet</servlet-name>\n"
+                                + "        <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>\n"
+                                + "    </servlet>\n"
+                                + "    <servlet-mapping>\n"
+                                + "        <servlet-name>JnlpDownloadServlet</servlet-name>\n"
+                                + "        <url-pattern>*.jnlp</url-pattern>\n"
+                                + "    </servlet-mapping>\n"
+                                + "</web-app>\n" ).getBytes() );
                     }
-                    public @Override long getLastModified()
+
+                    public @Override
+                    long getLastModified()
                     {
                         return UNKNOWN_MODIFICATION_DATE;
                     }
-                    public @Override boolean isExisting()
+
+                    public @Override
+                    boolean isExisting()
                     {
                         return true;
                     }
-                    public @Override long getSize()
+
+                    public @Override
+                    long getSize()
                     {
                         return UNKNOWN_RESOURCE_SIZE;
                     }
-                    public @Override URL getURL() throws IOException
+
+                    public @Override
+                    URL getURL() throws IOException
                     {
                         return null;
                     }
-                    public @Override String getName()
+
+                    public @Override
+                    String getName()
                     {
                         return "web.xml";
                     }
-                    public @Override boolean isFile()
+
+                    public @Override
+                    boolean isFile()
                     {
                         return true;
                     }
-                    public @Override boolean isDirectory()
+
+                    public @Override
+                    boolean isDirectory()
                     {
                         return false;
                     }
@@ -579,11 +610,11 @@
      * @return The name of the jnlp-launcher jarfile in the build directory
      */
     private File copyLauncher( File standaloneBuildDir, File builtInstallation )
-        throws IOException
+            throws IOException
     {
-        File jnlpStarter =
-            new File( builtInstallation.getAbsolutePath() + File.separator + "harness" + File.separator + "jnlp"
-                + File.separator + "jnlp-launcher.jar" );
+        File jnlpStarter
+                = new File( builtInstallation.getAbsolutePath() + File.separator + "harness" + File.separator + "jnlp"
+                        + File.separator + "jnlp-launcher.jar" );
         // buffer so it isn't reading a byte at a time!
         InputStream source = null;
         FileOutputStream outstream = null;
@@ -592,14 +623,14 @@
             if ( !jnlpStarter.exists() )
             {
                 source = getClass().getClassLoader().getResourceAsStream(
-                    "harness/jnlp/jnlp-launcher.jar" );
+                        "harness/jnlp/jnlp-launcher.jar" );
             }
             else
             {
                 source = new FileInputStream( jnlpStarter );
             }
             File jnlpDestination = new File(
-                standaloneBuildDir.getAbsolutePath() + File.separator + "jnlp-launcher.jar" );
+                    standaloneBuildDir.getAbsolutePath() + File.separator + "jnlp-launcher.jar" );
 
             outstream = new FileOutputStream( jnlpDestination );
             IOUtil.copy( source, outstream );
@@ -613,7 +644,7 @@
     }
 
     private void filterCopy( File sourceFile, String resourcePath, File destinationFile, Properties filterProperties )
-        throws IOException
+            throws IOException
     {
         // buffer so it isn't reading a byte at a time!
         Reader source = null;
@@ -648,6 +679,7 @@
 
     /**
      * copied from MakeMasterJNLP ant task.
+     *
      * @param files
      * @param antProject
      * @param masterPrefix
@@ -655,7 +687,7 @@
      * @throws java.io.IOException
      */
     private String generateExtensions( FileSet files, Project antProject, String masterPrefix )
-        throws IOException
+            throws IOException
     {
         StringBuilder buff = new StringBuilder();
         for ( String nm : files.getDirectoryScanner( antProject ).getIncludedFiles() )
@@ -678,7 +710,7 @@
             {
                 throw new IOException( "Not a NetBeans Module: " + jar );
             }
-            
+
             // see http://hg.netbeans.org/main-silver/rev/87823abb86d9
             if ( codenamebase.equals( "org.objectweb.asm.all" )
                     && jar.getParentFile().getName().equals( "core" )
@@ -695,7 +727,8 @@
             }
             String dashcnb = codenamebase.replace( '.', '-' );
 
-            buff.append( "    <extension name='" ).append( codenamebase ).append( "' href='" ).append( masterPrefix ).append( dashcnb ).append( ".jnlp' />\n" );
+            buff.append( "    <extension name='" ).append( codenamebase ).append( "' href='" ).append( masterPrefix ).
+                    append( dashcnb ).append( ".jnlp' />\n" );
             theJar.close();
         }
         return buff.toString();
diff --git a/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java b/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
index f0d9cb0..200da93 100644
--- a/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
@@ -66,21 +66,21 @@
 /**
  * Goal for generating NetBeans module system specific manifest entries, part of <code>nbm</code> lifecycle/packaging.
  *
- * In order to have the generated manifest picked up by the maven-jar-plugin,
- * one shall add the following configuration snippet to maven-jar-plugin.
- * 
+ * In order to have the generated manifest picked up by the maven-jar-plugin, one shall add the following configuration
+ * snippet to maven-jar-plugin.
+ *
  * <pre>
  *  {@code
-   <plugin>
-       <groupId>org.apache.maven.plugins</groupId>
-       <artifactId>maven-jar-plugin</artifactId>
-       <version>3.0.2</version>
-       <configuration>
-           <archive>
-               <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-           </archive>
-       </configuration>
-   </plugin>
+ * <plugin>
+ * <groupId>org.apache.maven.plugins</groupId>
+ * <artifactId>maven-jar-plugin</artifactId>
+ * <version>3.0.2</version>
+ * <configuration>
+ * <archive>
+ * <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ * </archive>
+ * </configuration>
+ * </plugin>
  * }
  * </pre>
  *
@@ -92,19 +92,20 @@
         threadSafe = true,
         requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class NetBeansManifestUpdateMojo
-    extends AbstractNbmMojo
+        extends AbstractNbmMojo
 {
 
     /**
-     * NetBeans module assembly build directory.
-     * directory where the the NetBeans jar and nbm file get constructed.
+     * NetBeans module assembly build directory. directory where the the NetBeans jar and nbm file get constructed.
      */
     @Parameter( defaultValue = "${project.build.directory}/nbm", property = "maven.nbm.buildDir" )
     protected File nbmBuildDir;
 
     /**
      * a NetBeans module descriptor containing dependency information and more
-     * @deprecated all content from the module descriptor can be defined as plugin configuration now, will be removed in 4.0 entirely
+     *
+     * @deprecated all content from the module descriptor can be defined as plugin configuration now, will be removed in
+     * 4.0 entirely
      */
     @Parameter( defaultValue = "${basedir}/src/main/nbm/module.xml" )
     protected File descriptor;
@@ -116,19 +117,20 @@
     private MavenProject project;
 
     /**
-     * The location of JavaHelp sources for the project. The documentation
-     * itself is expected to be in the directory structure based on codenamebase of the module.
-     * eg. if your codenamebase is "org.netbeans.modules.apisupport", then the actual docs
-     * files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs.
+     * The location of JavaHelp sources for the project. The documentation itself is expected to be in the directory
+     * structure based on codenamebase of the module. eg. if your codenamebase is "org.netbeans.modules.apisupport",
+     * then the actual docs files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs.
      * Obsolete as of NetBeans 7.0 with &#64;HelpSetRegistration.
+     *
      * @since 2.7
      */
     @Parameter( defaultValue = "${basedir}/src/main/javahelp" )
     protected File nbmJavahelpSource;
 
     /**
-     * Path to manifest file that will be used as base and enhanced with generated content. Any entry specified in the original file
-     * will not be overwritten
+     * Path to manifest file that will be used as base and enhanced with generated content. Any entry specified in the
+     * original file will not be overwritten
+     *
      * @since 3.0
      */
     @Parameter( required = true, defaultValue = "${basedir}/src/main/nbm/manifest.mf" )
@@ -136,66 +138,68 @@
 
     /**
      * Path to the generated MANIFEST file to use. It will be used by jar:jar plugin.
+     *
      * @since 3.0
      */
     @Parameter( required = true, readonly = true, defaultValue = "${project.build.outputDirectory}/META-INF/MANIFEST.MF" )
     private File targetManifestFile;
 
     /**
-     * Verify the runtime NetBeans module dependencies and Class-Path items
-     * generated from Maven dependencies. The check is done by matching classes used
-     * in current project. Allowed values for the parameter are <code>fail</code>, <code>warn</code> and <code>skip</code>.
-     * The default is <code>fail</code> in which case the validation failure results in a failed build,
-     * in the vast majority of cases the module would fail at runtime anyway.
+     * Verify the runtime NetBeans module dependencies and Class-Path items generated from Maven dependencies. The check
+     * is done by matching classes used in current project. Allowed values for the parameter are <code>fail</code>,
+     * <code>warn</code> and <code>skip</code>. The default is <code>fail</code> in which case the validation failure
+     * results in a failed build, in the vast majority of cases the module would fail at runtime anyway.
      *
      * @since 3.0
      */
     @Parameter( property = "maven.nbm.verify", defaultValue = "fail" )
     private String verifyRuntime;
-    
+
     private static final String FAIL = "fail";
     private static final String WARN = "warn";
     private static final String SKIP = "skip";
 
     /**
-     * A list of module's public packages. If not defined, no packages are exported as public.
-     * Allowed values are single package names
-     * or package names ending with .* which represent the package and all subpackages.
+     * A list of module's public packages. If not defined, no packages are exported as public. Allowed values are single
+     * package names or package names ending with .* which represent the package and all subpackages.
      * <p/>
-     * Eg. "org.kleint.milos.api" designates just the one package, while "org.kleint.milos.spi.*"
-     * denotes the spi package an all it's subpackages.
+     * Eg. "org.kleint.milos.api" designates just the one package, while "org.kleint.milos.spi.*" denotes the spi
+     * package an all it's subpackages.
+     *
      * @since 3.0
      */
     @Parameter
     private List<String> publicPackages;
 
     /**
-     * When encountering an OSGi bundle among dependencies, the plugin will generate a direct dependency
-     * on the bundle and will not include the bundle's jar into the nbm. Will only work with NetBeans 6.9+ runtime.
-     * Therefore it is off by default.
-     * WARNING: Additionally existing applications/modules need to check modules wrapping
-     * external libraries for library jars that are also OSGi bundles. Such modules will no longer include the OSGi bundles
-     * as part of the module but will include a modular dependency on the bundle. Modules depending on these old wrappers
+     * When encountering an OSGi bundle among dependencies, the plugin will generate a direct dependency on the bundle
+     * and will not include the bundle's jar into the nbm. Will only work with NetBeans 6.9+ runtime. Therefore it is
+     * off by default. WARNING: Additionally existing applications/modules need to check modules wrapping external
+     * libraries for library jars that are also OSGi bundles. Such modules will no longer include the OSGi bundles as
+     * part of the module but will include a modular dependency on the bundle. Modules depending on these old wrappers
      * shall depend directly on the bundle, eventually rendering the old library wrapper module obsolete.
      *
      * @since 3.2
      */
     @Parameter( defaultValue = "false" )
     private boolean useOSGiDependencies;
-    
+
     /**
-     * codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package name equivalent.
-     * Can include the major release version.
-     * See <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-manifest"> NetBeans Module system docs</a>
+     * codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package
+     * name equivalent. Can include the major release version. See
+     * <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-manifest">
+     * NetBeans Module system docs</a>
+     *
      * @since 3.8
      */
     @Parameter( defaultValue = "${project.groupId}.${project.artifactId}" )
     private String codeNameBase;
-    
+
     /**
-     * List of explicit module dependency declarations overriding the default specification dependency. Useful when depending on a range of major versions,
-     * depending on implementation version etc.
-     * <p>The format is:
+     * List of explicit module dependency declarations overriding the default specification dependency. Useful when
+     * depending on a range of major versions, depending on implementation version etc.
+     * <p>
+     * The format is:
      * <pre>
      * &lt;dependency&gt;
      *    &lt;id&gt;groupId:artifactId&lt;/id&gt;
@@ -205,50 +209,55 @@
      * </pre>
      * </p>
      * <p>
-     * where <code>id</code> is composed of grouId and artifactId of a dependency defined in effective pom, separated by double colon. This is mandatory.</p>
+     * where <code>id</code> is composed of grouId and artifactId of a dependency defined in effective pom, separated by
+     * double colon. This is mandatory.</p>
      * <p>
-     * Then there are 2 exclusively optional fields <code>type</code> and <code>explicitValue</code>, if both are defined <code>explicitValue</code> gets applied.
+     * Then there are 2 exclusively optional fields <code>type</code> and <code>explicitValue</code>, if both are
+     * defined <code>explicitValue</code> gets applied.
      * </p>
-     * <p><code>type</code> values: <code>spec</code> means specification dependency.That's the default. 
-     * <code>impl</code> means implementation dependency, only the exact version match will satisfy the constraint. 
-     * <code>loose</code> means loose dependency, no requirement on version, the module just has to be present. Not very common option.
-     * 
+     * <p>
+     * <code>type</code> values: <code>spec</code> means specification dependency.That's the default. <code>impl</code>
+     * means implementation dependency, only the exact version match will satisfy the constraint. <code>loose</code>
+     * means loose dependency, no requirement on version, the module just has to be present. Not very common option.
+     *
      * @since 3.8
      */
     @Parameter
     private Dependency[] moduleDependencies;
-    
-/**
+
+    /**
      * Deployment type of the module, allowed values are <code>normal</code>,<code>eager</code>,<code>autoload</code>,
      * <code>disabled</code>.
      * <p>
-     * <code>autoload</code> - Such a module is
-     * automatically enabled when some other module requires it and
+     * <code>autoload</code> - Such a module is automatically enabled when some other module requires it and
      * automatically disabled otherwise.</p>
-     *                     <p><code>eager</code> - This module type gets
-     * automatically enabled when all it's dependencies are
-     * satisfied. Disabled otherwise.</p>
-     *                     <p><code>normal</code> - This is the default
-     * value. This kind of module is enabled/disabled manually by
-     * the user. It installs enabled.</p>
-     *                     <p><code>disabled</code> - This kind of module is enabled/disabled manually by
-     * the user. It installs disabled. Since 3.11</p>
+     * <p>
+     * <code>eager</code> - This module type gets automatically enabled when all it's dependencies are satisfied.
+     * Disabled otherwise.</p>
+     * <p>
+     * <code>normal</code> - This is the default value. This kind of module is enabled/disabled manually by the user. It
+     * installs enabled.</p>
+     * <p>
+     * <code>disabled</code> - This kind of module is enabled/disabled manually by the user. It installs disabled. Since
+     * 3.11</p>
      *
-     * For details, see <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#enablement">Netbeans Module system docs</a>
-     * 
-     * Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to false, if not defined already otherwise in the manifest.
-     * See issue <a href="http://jira.codehaus.org/browse/MNBMODULE-194">MNBMODULE-194</a>
-     * 
+     * For details, see
+     * <a href="http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#enablement">Netbeans
+     * Module system docs</a>
+     *
+     * Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to
+     * false, if not defined already otherwise in the manifest. See issue
+     * <a href="http://jira.codehaus.org/browse/MNBMODULE-194">MNBMODULE-194</a>
+     *
      * @since 3.8 (3.14 in manifest goal)
-     */ 
+     */
     @Parameter( defaultValue = "normal" )
     protected String moduleType;
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
-
     /**
      * The artifact repository to use.
-
+     *
      */
     @Parameter( required = true, readonly = true, defaultValue = "${localRepository}" )
     private ArtifactRepository localRepository;
@@ -279,14 +288,14 @@
 
 // end of component params custom code folding
 // </editor-fold> 
-
     /**
      * execute plugin
+     *
      * @throws MojoExecutionException if an unexpected problem occurs
      * @throws MojoFailureException if an expected problem occurs
      */
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
 
     {
         //need to do this to chekc for javahelp on CP.
@@ -301,7 +310,7 @@
         {
             module = createDefaultDescriptor( project, false );
         }
-        
+
         String mtype = moduleType;
         //same moduleType related code in CreateNetBeansFileStructure.java
         if ( "normal".equals( mtype ) && module.getModuleType() != null )
@@ -309,13 +318,13 @@
             mtype = module.getModuleType();
             getLog().warn( "moduleType in module descriptor is deprecated, use the plugin's parameter moduleType" );
         }
-        if ( !"normal".equals( mtype ) && !"autoload".equals( mtype ) && !"eager".equals( mtype ) && !"disabled".equals( mtype ) )
+        if ( !"normal".equals( mtype ) && !"autoload".equals( mtype ) && !"eager".equals( mtype ) && !"disabled".
+                equals( mtype ) )
         {
             getLog().error( "Only 'normal,autoload,eager,disabled' are allowed values in the moduleType parameter" );
         }
         boolean autoload = "autoload".equals( mtype );
         boolean eager = "eager".equals( mtype );
-        
 
         String moduleName = codeNameBase;
         if ( module.getCodeNameBase() != null )
@@ -328,7 +337,7 @@
 // ignoring the case when some of the NetBeans attributes are already defined in the jar and more is included.
         File specialManifest = sourceManifestFile;
         File nbmManifest = ( module.getManifest() != null ? new File(
-            project.getBasedir(), module.getManifest() ) : null );
+                project.getBasedir(), module.getManifest() ) : null );
         if ( nbmManifest != null && nbmManifest.exists() )
         {
             //deprecated, but if actually defined, will use it.
@@ -377,21 +386,21 @@
         }
         Date date = new Date();
         String specVersion = AdaptNbVersion.adaptVersion( project.getVersion(),
-            AdaptNbVersion.TYPE_SPECIFICATION, date );
+                AdaptNbVersion.TYPE_SPECIFICATION, date );
         String implVersion = AdaptNbVersion.adaptVersion( project.getVersion(),
-            AdaptNbVersion.TYPE_IMPLEMENTATION, date );
+                AdaptNbVersion.TYPE_IMPLEMENTATION, date );
         Manifest.Section mainSection = manifest.getMainSection();
         conditionallyAddAttribute( mainSection,
-            "OpenIDE-Module-Specification-Version", specVersion );
+                "OpenIDE-Module-Specification-Version", specVersion );
         conditionallyAddAttribute( mainSection,
-            "OpenIDE-Module-Implementation-Version", implVersion );
+                "OpenIDE-Module-Implementation-Version", implVersion );
         if ( autoload || eager )
         { //MNBMODULE-194
             conditionallyAddAttribute( mainSection, "AutoUpdate-Show-In-Client", "false" );
         }
         final String timestamp = createTimestamp( date );
         conditionallyAddAttribute( mainSection, "OpenIDE-Module-Build-Version",
-            timestamp );
+                timestamp );
         String projectCNB = conditionallyAddAttribute( mainSection, "OpenIDE-Module", moduleName );
         String packagesValue;
         if ( publicPackages != null && publicPackages.size() > 0 )
@@ -439,140 +448,141 @@
 
         //See http://www.netbeans.org/download/dev/javadoc/org-openide-modules/apichanges.html#split-of-openide-jar
         conditionallyAddAttribute( mainSection, "OpenIDE-Module-Requires",
-            "org.openide.modules.ModuleFormat1" );
+                "org.openide.modules.ModuleFormat1" );
 //        conditionallyAddAttribute(mainSection, "OpenIDE-Module-IDE-Dependencies", "IDE/1 > 3.40");
         // localization items
         if ( !examinator.isLocalized() )
         {
             conditionallyAddAttribute( mainSection,
-                "OpenIDE-Module-Display-Category", project.getGroupId() );
+                    "OpenIDE-Module-Display-Category", project.getGroupId() );
             conditionallyAddAttribute( mainSection, "OpenIDE-Module-Name",
-                project.getName() );
+                    project.getName() );
             conditionallyAddAttribute( mainSection,
-                "OpenIDE-Module-Short-Description", shorten( project.getDescription() ) );
+                    "OpenIDE-Module-Short-Description", shorten( project.getDescription() ) );
             conditionallyAddAttribute( mainSection,
-                "OpenIDE-Module-Long-Description", project.getDescription() );
+                    "OpenIDE-Module-Long-Description", project.getDescription() );
         }
         getLog().debug( "module =" + module );
-        
-            DependencyNode treeroot = createDependencyTree( project, dependencyGraphBuilder, "compile" );
-            Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
-            @SuppressWarnings( "unchecked" )
-            List<Artifact> libArtifacts = getLibraryArtifacts( treeroot, module, project.getRuntimeArtifacts(),
+
+        DependencyNode treeroot = createDependencyTree( project, dependencyGraphBuilder, "compile" );
+        Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
+        @SuppressWarnings( "unchecked" )
+        List<Artifact> libArtifacts = getLibraryArtifacts( treeroot, module, project.getRuntimeArtifacts(),
                 examinerCache, getLog(), useOSGiDependencies );
-            List<ModuleWrapper> moduleArtifacts = getModuleDependencyArtifacts( treeroot, module, moduleDependencies, project, examinerCache,
+        List<ModuleWrapper> moduleArtifacts = getModuleDependencyArtifacts( treeroot, module, moduleDependencies,
+                project, examinerCache,
                 libArtifacts, getLog(), useOSGiDependencies );
-            StringBuilder classPath = new StringBuilder();
-            StringBuilder mavenClassPath = new StringBuilder();
-            String dependencies = "";
-            String depSeparator = " ";
+        StringBuilder classPath = new StringBuilder();
+        StringBuilder mavenClassPath = new StringBuilder();
+        String dependencies = "";
+        String depSeparator = " ";
 
-            for ( Artifact a : libArtifacts )
+        for ( Artifact a : libArtifacts )
+        {
+            if ( classPath.length() > 0 )
             {
-                if ( classPath.length() > 0 )
-                {
-                    classPath.append( ' ' );
-                }
-                classPath.append( artifactToClassPathEntry( a, codeNameBase ) );
-                if ( mavenClassPath.length() > 0 )
-                {
-                    mavenClassPath.append( ' ' );
-                }
-                mavenClassPath.append( a.getGroupId() ).
-                        append( ':' ).
-                        append( a.getArtifactId() ).
-                        append( ':' ).
-                        append( a.getBaseVersion() );
-                
-                if ( a.getClassifier() != null ) 
-                {
-                    mavenClassPath.append( ":" ).append( a.getClassifier() );
-                }
+                classPath.append( ' ' );
             }
-
-            for ( ModuleWrapper wr : moduleArtifacts )
+            classPath.append( artifactToClassPathEntry( a, codeNameBase ) );
+            if ( mavenClassPath.length() > 0 )
             {
-                if ( wr.transitive )
+                mavenClassPath.append( ' ' );
+            }
+            mavenClassPath.append( a.getGroupId() ).
+                    append( ':' ).
+                    append( a.getArtifactId() ).
+                    append( ':' ).
+                    append( a.getBaseVersion() );
+
+            if ( a.getClassifier() != null )
+            {
+                mavenClassPath.append( ":" ).append( a.getClassifier() );
+            }
+        }
+
+        for ( ModuleWrapper wr : moduleArtifacts )
+        {
+            if ( wr.transitive )
+            {
+                continue;
+            }
+            Dependency dep = wr.dependency;
+            Artifact artifact = wr.artifact;
+            ExamineManifest depExaminator = examinerCache.get( artifact );
+            String type = dep.getType();
+            String depToken = dep.getExplicitValue();
+            if ( depToken == null )
+            {
+                if ( "loose".equals( type ) )
                 {
-                    continue;
+                    depToken = depExaminator.getModuleWithRelease();
                 }
-                Dependency dep = wr.dependency;
-                Artifact artifact = wr.artifact;
-                ExamineManifest depExaminator = examinerCache.get( artifact );
-                String type = dep.getType();
-                String depToken = dep.getExplicitValue();
-                if ( depToken == null )
+                else if ( "spec".equals( type ) )
                 {
-                    if ( "loose".equals( type ) )
-                    {
-                        depToken = depExaminator.getModuleWithRelease();
-                    }
-                    else if ( "spec".equals( type ) )
-                    {
-                        depToken =
-                            depExaminator.getModuleWithRelease()
-                                + " > "
-                                + ( depExaminator.isNetBeansModule() ? depExaminator.getSpecVersion()
-                                                : AdaptNbVersion.adaptVersion( depExaminator.getSpecVersion(),
-                                                                               AdaptNbVersion.TYPE_SPECIFICATION, date ) );
-                    }
-                    else if ( "impl".equals( type ) )
-                    {
-                        depToken =
-                            depExaminator.getModuleWithRelease()
-                                + " = "
-                                + ( depExaminator.isNetBeansModule() ? depExaminator.getImplVersion()
-                                                : AdaptNbVersion.adaptVersion( depExaminator.getImplVersion(),
-                                                                               AdaptNbVersion.TYPE_IMPLEMENTATION, date ) );
-                    }
-                    else
-                    {
-                        throw new MojoExecutionException(
-                            "Wrong type of NetBeans dependency: " + type + " Allowed values are: loose, spec, impl." );
-                    }
+                    depToken
+                            = depExaminator.getModuleWithRelease()
+                            + " > "
+                            + ( depExaminator.isNetBeansModule() ? depExaminator.getSpecVersion()
+                            : AdaptNbVersion.adaptVersion( depExaminator.getSpecVersion(),
+                                    AdaptNbVersion.TYPE_SPECIFICATION, date ) );
                 }
-                if ( depToken == null )
+                else if ( "impl".equals( type ) )
                 {
-                    //TODO report
-                    getLog().error(
-                        "Cannot properly resolve the NetBeans dependency for " + dep.getId() );
+                    depToken
+                            = depExaminator.getModuleWithRelease()
+                            + " = "
+                            + ( depExaminator.isNetBeansModule() ? depExaminator.getImplVersion()
+                            : AdaptNbVersion.adaptVersion( depExaminator.getImplVersion(),
+                                    AdaptNbVersion.TYPE_IMPLEMENTATION, date ) );
                 }
                 else
                 {
-                    dependencies = dependencies + depSeparator + depToken;
-                    depSeparator = ", ";
+                    throw new MojoExecutionException(
+                            "Wrong type of NetBeans dependency: " + type + " Allowed values are: loose, spec, impl." );
                 }
             }
-            if ( !verifyRuntime.equalsIgnoreCase( SKIP ) )
+            if ( depToken == null )
             {
-                try
-                {
-                    checkModuleClassPath( treeroot, libArtifacts, examinerCache, moduleArtifacts, projectCNB );
-                }
-                catch ( IOException ex )
-                {
-                    throw new MojoExecutionException( "Error while checking runtime dependencies", ex );
-                }
+                //TODO report
+                getLog().error(
+                        "Cannot properly resolve the NetBeans dependency for " + dep.getId() );
             }
+            else
+            {
+                dependencies = dependencies + depSeparator + depToken;
+                depSeparator = ", ";
+            }
+        }
+        if ( !verifyRuntime.equalsIgnoreCase( SKIP ) )
+        {
+            try
+            {
+                checkModuleClassPath( treeroot, libArtifacts, examinerCache, moduleArtifacts, projectCNB );
+            }
+            catch ( IOException ex )
+            {
+                throw new MojoExecutionException( "Error while checking runtime dependencies", ex );
+            }
+        }
 
-            if ( nbmJavahelpSource.exists() )
-            {
-                String moduleJarName = stripVersionFromCodebaseName( moduleName ).replace( ".", "-" );
-                classPath.append( " docs/" ).append( moduleJarName ).append( ".jar" );
-            }
+        if ( nbmJavahelpSource.exists() )
+        {
+            String moduleJarName = stripVersionFromCodebaseName( moduleName ).replace( ".", "-" );
+            classPath.append( " docs/" ).append( moduleJarName ).append( ".jar" );
+        }
 
-            if ( classPath.length() > 0 )
-            {
-                conditionallyAddAttribute( mainSection, "X-Class-Path", classPath.toString().trim() );
-            }
-            if ( mavenClassPath.length() > 0 )
-            {
-                conditionallyAddAttribute( mainSection, "Maven-Class-Path", mavenClassPath.toString() );
-            }
-            if ( dependencies.length() > 0 )
-            {
-                conditionallyAddAttribute( mainSection, "OpenIDE-Module-Module-Dependencies", dependencies );
-            }
+        if ( classPath.length() > 0 )
+        {
+            conditionallyAddAttribute( mainSection, "X-Class-Path", classPath.toString().trim() );
+        }
+        if ( mavenClassPath.length() > 0 )
+        {
+            conditionallyAddAttribute( mainSection, "Maven-Class-Path", mavenClassPath.toString() );
+        }
+        if ( dependencies.length() > 0 )
+        {
+            conditionallyAddAttribute( mainSection, "OpenIDE-Module-Module-Dependencies", dependencies );
+        }
 //            if ( librList.size() > 0 )
 //            {
 //                String list = "";
@@ -607,15 +617,15 @@
     //MNBMODULE-137
     static String artifactToClassPathEntry( Artifact a, String codenamebase )
     {
-        return "ext/" + codenamebase + "/" + a.getGroupId().replace( '.', '-' ) + "/" + a.getArtifactId() + ( a.getClassifier() != null ? "-" + a.getClassifier() : "" ) + "." + a.getArtifactHandler().getExtension();
+        return "ext/" + codenamebase + "/" + a.getGroupId().replace( '.', '-' ) + "/" + a.getArtifactId() + ( a.
+                getClassifier() != null ? "-" + a.getClassifier() : "" ) + "." + a.getArtifactHandler().getExtension();
     }
 
     /**
-     * Create a timestamp for <code>OpenIDE-Module-Build-Version</code> manifest
-     * entry.
+     * Create a timestamp for <code>OpenIDE-Module-Build-Version</code> manifest entry.
      *
-     * It's created from the current time and formatted using a UTC timezone
-     * explicitly which makes created timestamp timezone-independent.
+     * It's created from the current time and formatted using a UTC timezone explicitly which makes created timestamp
+     * timezone-independent.
      *
      * @return timestamp represented as <code>201012292045</code>
      */
@@ -662,6 +672,7 @@
 
     /**
      * Pick out the first sentence of a paragraph.
+     *
      * @param paragraph some text (may be null)
      * @return the first sentence (may be null)
      */
@@ -680,9 +691,10 @@
 // classpat checking related.
 //----------------------------------------------------------------------------------
     private void checkModuleClassPath( DependencyNode treeroot,
-        List<Artifact> libArtifacts,
-        Map<Artifact, ExamineManifest> examinerCache, List<ModuleWrapper> moduleArtifacts, String projectCodeNameBase )
-        throws IOException, MojoExecutionException, MojoFailureException
+            List<Artifact> libArtifacts,
+            Map<Artifact, ExamineManifest> examinerCache, List<ModuleWrapper> moduleArtifacts,
+            String projectCodeNameBase )
+            throws IOException, MojoExecutionException, MojoFailureException
     {
         Set<String> deps = buildProjectDependencyClasses( project, libArtifacts );
         deps.retainAll( allProjectClasses( project ) );
@@ -690,7 +702,7 @@
         Set<String> own = projectModuleOwnClasses( project, libArtifacts );
         deps.removeAll( own );
         CollectModuleLibrariesNodeVisitor visitor = new CollectModuleLibrariesNodeVisitor(
-            project.getRuntimeArtifacts(), examinerCache, getLog(), treeroot, useOSGiDependencies );
+                project.getRuntimeArtifacts(), examinerCache, getLog(), treeroot, useOSGiDependencies );
         treeroot.accept( visitor );
         Map<String, List<Artifact>> modules = visitor.getDeclaredArtifacts();
         Map<Artifact, Set<String>> moduleAllClasses = new HashMap<Artifact, Set<String>>();
@@ -724,16 +736,20 @@
                     {
                         String module = wr.osgi ? "OSGi bundle" : "module";
                         getLog().error(
-                            "Project uses classes from transitive " + module + " " + wr.artifact.getId() + " which will not be accessible at runtime." );
-                        getLog().info( "    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter" );
+                                "Project uses classes from transitive " + module + " " + wr.artifact.getId()
+                                + " which will not be accessible at runtime." );
+                        getLog().info(
+                                "    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter" );
                         deps.removeAll( classes[0] );
                     }
                     classes[1].retainAll( deps );
                     if ( classes[1].size() > 0 )
                     {
-                        getLog().info( "Private classes referenced in transitive module: " + Arrays.toString( classes[1].toArray() ) );
+                        getLog().info( "Private classes referenced in transitive module: " + Arrays.toString(
+                                classes[1].toArray() ) );
                         getLog().error(
-                            "Project depends on packages not accessible at runtime in transitive module " + wr.artifact.getId() + " which will not be accessible at runtime." );
+                                "Project depends on packages not accessible at runtime in transitive module "
+                                + wr.artifact.getId() + " which will not be accessible at runtime." );
                         deps.removeAll( classes[1] );
                     }
                 }
@@ -745,33 +761,38 @@
                 {
                     strs.retainAll( e.getValue() );
                     getLog().info( "Private classes referenced in module: " + Arrays.toString( strs.toArray() ) );
-                    getLog().error( "Project depends on packages not accessible at runtime in module " + e.getKey().getId() );
+                    getLog().error( "Project depends on packages not accessible at runtime in module " + e.getKey().
+                            getId() );
                 }
             }
             if ( verifyRuntime.equalsIgnoreCase( FAIL ) )
             {
                 if ( !deps.isEmpty() )
                 {
-                    throw new MojoFailureException( "Uncategorized problems with NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency metadata). Supposedly external classes are used in the project's binaries but the classes are not found on classpath. Class usages: " + deps );
+                    throw new MojoFailureException(
+                            "Uncategorized problems with NetBeans dependency verification (maybe MNBMODULE-102 or wrong maven dependency metadata). Supposedly external classes are used in the project's binaries but the classes are not found on classpath. Class usages: "
+                            + deps );
                 }
                 else
                 {
-                    throw new MojoFailureException( "See above for failures in runtime NetBeans dependencies verification." );
+                    throw new MojoFailureException(
+                            "See above for failures in runtime NetBeans dependencies verification." );
                 }
             }
         }
     }
 
     /**
-     * The current projects's dependencies, includes classes used in teh module itself
-     * and the classpath libraries as well.
+     * The current projects's dependencies, includes classes used in teh module itself and the classpath libraries as
+     * well.
+     *
      * @param project
      * @param libraries
      * @return
      * @throws java.io.IOException
      */
     private Set<String> buildProjectDependencyClasses( MavenProject project, List<Artifact> libraries )
-        throws IOException
+            throws IOException
     {
         Set<String> dependencyClasses = new HashSet<String>();
 
@@ -787,7 +808,7 @@
 
     @SuppressWarnings( "unchecked" )
     private Set<String> projectModuleOwnClasses( MavenProject project, List<Artifact> libraries )
-        throws IOException
+            throws IOException
     {
         Set<String> projectClasses = new HashSet<String>();
         DefaultClassAnalyzer analyzer = new DefaultClassAnalyzer();
@@ -806,15 +827,15 @@
     }
 
     /**
-     * complete list of classes on project runtime classpath (excluding
-     * jdk bit)
+     * complete list of classes on project runtime classpath (excluding jdk bit)
+     *
      * @param project
      * @return
      * @throws java.io.IOException
      */
     @SuppressWarnings( "unchecked" )
     private Set<String> allProjectClasses( MavenProject project )
-        throws IOException
+            throws IOException
     {
         Set<String> projectClasses = new HashSet<String>();
         DefaultClassAnalyzer analyzer = new DefaultClassAnalyzer();
@@ -835,9 +856,9 @@
     }
 
     private Set<String>[] visibleModuleClasses( List<Artifact> moduleLibraries,
-        ExamineManifest manifest, Dependency dep, String projectCodeNameBase,
-        boolean transitive )
-        throws IOException, MojoFailureException
+            ExamineManifest manifest, Dependency dep, String projectCodeNameBase,
+            boolean transitive )
+            throws IOException, MojoFailureException
     {
         Set<String> moduleClasses = new HashSet<String>();
         Set<String> visibleModuleClasses = new HashSet<String>();
@@ -866,7 +887,8 @@
             String cnb = stripVersionFromCodebaseName( projectCodeNameBase );
             if ( !transitive && manifest.hasFriendPackages() && !manifest.getFriends().contains( cnb ) )
             {
-                String message = "Module has friend dependency on " + manifest.getModule() + " but is not listed as a friend.";
+                String message = "Module has friend dependency on " + manifest.getModule()
+                        + " but is not listed as a friend.";
                 if ( verifyRuntime.equalsIgnoreCase( FAIL ) )
                 {
                     throw new MojoFailureException( message );
@@ -886,7 +908,7 @@
             {
                 for ( Pattern patt : compiled )
                 {
-                    if ( patt.matcher( clazz ).matches() ) 
+                    if ( patt.matcher( clazz ).matches() )
                     {
                         visibleModuleClasses.add( clazz );
                         break;
@@ -906,10 +928,10 @@
         }
 
         return new Set[]
-            {
-                visibleModuleClasses,
-                moduleClasses
-            };
+        {
+            visibleModuleClasses,
+            moduleClasses
+        };
     }
 
     static List<Pattern> createCompiledPatternList( List<String> packages )
@@ -933,7 +955,7 @@
 
     @SuppressWarnings( "unchecked" )
     private Set<String> buildDependencyClasses( String path )
-        throws IOException
+            throws IOException
     {
         URL url = new File( path ).toURI().toURL();
         ASMDependencyAnalyzer dependencyAnalyzer = new ASMDependencyAnalyzer();
diff --git a/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java b/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
index 9b20876..38d02ce 100644
--- a/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
@@ -20,8 +20,10 @@
  */
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.List;
@@ -38,9 +40,9 @@
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
 /**
- * Run NetBeans IDE with additional custom module clusters, 
- * to be used in conjunction with nbm:cluster.
- * Semi-deprecated; used only for standalone modules and "suites".
+ * Run NetBeans IDE with additional custom module clusters, to be used in conjunction with nbm:cluster. Semi-deprecated;
+ * used only for standalone modules and "suites".
+ *
  * @author Milos Kleint
  *
  */
@@ -50,14 +52,13 @@
 {
 
     /**
-     * directory where the module(s)' NetBeans cluster(s) are located.
-     * is related to nbm:cluster goal.
+     * directory where the module(s)' NetBeans cluster(s) are located. is related to nbm:cluster goal.
      */
     @Parameter( required = true, defaultValue = "${project.build.directory}/netbeans_clusters" )
     protected File clusterBuildDir;
     /**
-     * directory where the the NetBeans platform/IDE installation is,
-     * denotes the root directory of NetBeans installation.
+     * directory where the the NetBeans platform/IDE installation is, denotes the root directory of NetBeans
+     * installation.
      */
     @Parameter( required = true, property = "netbeans.installation" )
     protected File netbeansInstallation;
@@ -67,28 +68,29 @@
     @Parameter( required = true, defaultValue = "${project.build.directory}/userdir", property = "netbeans.userdir" )
     protected File netbeansUserdir;
     /**
-     * additional command line arguments. 
+     * additional command line arguments.
      */
     @Parameter( property = "netbeans.run.params" )
     protected String additionalArguments;
-    
+
     /**
-     * Attach a debugger to the application JVM. If set to "true", the process will suspend and wait for a debugger to attach
-     * on port 5005. If set to some other string, that string will be appended to the <code>additionalArguments</code>, allowing you to configure
-     * arbitrary debug-ability options (without overwriting the other options specified through the <code>additionalArguments</code>
-     * parameter).
+     * Attach a debugger to the application JVM. If set to "true", the process will suspend and wait for a debugger to
+     * attach on port 5005. If set to some other string, that string will be appended to the
+     * <code>additionalArguments</code>, allowing you to configure arbitrary debug-ability options (without overwriting
+     * the other options specified through the <code>additionalArguments</code> parameter).
+     *
      * @since 3.11.1
      */
     @Parameter( property = "netbeans.run.params.debug" )
-    protected String debugAdditionalArguments;    
+    protected String debugAdditionalArguments;
 
     /**
-     * 
+     *
      * @throws MojoExecutionException if an unexpected problem occurs
      * @throws MojoFailureException if an expected problem occurs
      */
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         netbeansUserdir.mkdirs();
 
@@ -96,7 +98,7 @@
         if ( !clusterBuildDir.exists() || clusterBuildDir.listFiles() == null )
         {
             throw new MojoExecutionException(
-                                              "No clusters to include in execution found. Please run the nbm:cluster or nbm:cluster-app goals before this one." );
+                    "No clusters to include in execution found. Please run the nbm:cluster or nbm:cluster-app goals before this one." );
         }
         File[] fls = clusterBuildDir.listFiles();
         for ( int i = 0; i < fls.length; i++ )
@@ -116,15 +118,13 @@
         {
             buff.deleteCharAt( buff.lastIndexOf( ":" ) );
         }
-        //http://www.netbeans.org/issues/show_bug.cgi?id=174819
-        StringReader sr =
-            new StringReader( "netbeans_extraclusters=\"" + buff.toString() + "\"\n" + "extraclusters=\""
-                + buff.toString() + "\"\n" + "extra_clusters=\"" + buff.toString() + "\"" );
+
+        getLog().debug( "cluster path:\n" + buff.toString() );
 
         //now check what the exec names are to figure the right XXX.clusters name
         File binDir = new File( netbeansInstallation, "bin" );
         File[] execs = binDir.listFiles();
-        String clust = null;
+        String appName = null;
         if ( execs != null )
         {
             for ( File f : execs )
@@ -137,30 +137,35 @@
                 name = name.replaceFirst( "(64)?([.]exe)?$", "" );
                 if ( !name.contains( "." ) )
                 {
-                    if ( clust == null )
+                    if ( appName == null )
                     {
-                        clust = name;
+                        appName = name;
                     }
                     else
                     {
-                        if ( !clust.equals( name ) )
+                        if ( !appName.equals( name ) )
                         {
                             getLog().debug( "When examining executable names, found clashing results " + f.getName()
-                                                + " " + clust );
+                                    + " " + appName );
                         }
                     }
                 }
             }
         }
-        if ( clust == null )
+        if ( appName == null )
         {
-            clust = "netbeans";
+            appName = "netbeans";
         }
 
+        //http://www.netbeans.org/issues/show_bug.cgi?id=174819
+        StringReader sr = new StringReader( appName + "_extraclusters=\"" + buff.toString() + "\"\n"
+                + "extraclusters=\""
+                + buff.toString() + "\"\n" + "extra_clusters=\"" + buff.toString() + "\"" );
+
         // write XXX.conf file with cluster information...
         File etc = new File( netbeansUserdir, "etc" );
         etc.mkdirs();
-        File confFile = new File( etc, clust + ".conf" );
+        File confFile = new File( etc, appName + ".conf" );
         FileOutputStream conf = null;
         try
         {
@@ -176,6 +181,18 @@
             IOUtil.close( conf );
         }
 
+        if ( getLog().isDebugEnabled() )
+        {
+            try ( InputStream io = new FileInputStream( confFile ) )
+            {
+                getLog().debug( "Configuration file content:\n" + IOUtil.toString( io ) );
+            }
+            catch ( IOException ex )
+            {
+                throw new MojoExecutionException( "Error writing " + confFile, ex );
+            }
+        }
+
         boolean windows = Os.isFamily( "windows" );
         Commandline cmdLine = new Commandline();
         File exec;
@@ -185,25 +202,28 @@
             if ( !exec.exists() )
             {
                 // in 6.7 and onward, there's no nb.exe file.
-                exec = new File( netbeansInstallation, "bin\\" + clust + ".exe" );
+                exec = new File( netbeansInstallation, "bin\\" + appName + ".exe" );
                 String jdkHome = System.getenv( "JAVA_HOME" );
                 if ( jdkHome != null )
                 {
                     if ( new File( jdkHome, "jre\\lib\\amd64\\jvm.cfg" ).exists() )
                     {
-                        File exec64 = new File( netbeansInstallation, "bin\\" + clust + "64.exe" );
+                        File exec64 = new File( netbeansInstallation, "bin\\" + appName + "64.exe" );
                         if ( exec64.isFile() )
                         {
                             exec = exec64;
                         }
                     }
                 }
-                cmdLine.addArguments( new String[] { "--console", "suppress" } );
+                cmdLine.addArguments( new String[]
+                {
+                    "--console", "suppress"
+                } );
             }
         }
         else
         {
-            exec = new File( netbeansInstallation, "bin/" + clust );
+            exec = new File( netbeansInstallation, "bin/" + appName );
         }
         cmdLine.setExecutable( exec.getAbsolutePath() );
 
@@ -242,13 +262,13 @@
             throw new MojoExecutionException( "Failed executing NetBeans", e );
         }
     }
-    
+
     private String getDebugAdditionalArguments()
     {
-       if ( "true".equals( debugAdditionalArguments ) )
+        if ( "true".equals( debugAdditionalArguments ) )
         {
             return "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005";
         }
         return debugAdditionalArguments;
-    }    
+    }
 }
diff --git a/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java b/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
index 87cd5ba..e73e068 100644
--- a/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
@@ -35,8 +35,9 @@
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
 /**
- * Run a branded application on top of NetBeans Platform. To be used with projects
- * with nbm-application packaging only and the project needs to be built first.
+ * Run a branded application on top of NetBeans Platform. To be used with projects with nbm-application packaging only
+ * and the project needs to be built first.
+ *
  * @author Milos Kleint
  *
  */
@@ -62,22 +63,22 @@
     @Parameter( required = true, defaultValue = "${project.build.directory}/userdir", property = "netbeans.userdir" )
     protected File netbeansUserdir;
     /**
-     * additional command line arguments passed to the application.
-     * can be used to debug the IDE.
+     * additional command line arguments passed to the application. can be used to debug the IDE.
      */
     @Parameter( property = "netbeans.run.params" )
     protected String additionalArguments;
-    
+
     /**
-     * Attach a debugger to the application JVM. If set to "true", the process will suspend and wait for a debugger to attach
-     * on port 5005. If set to some other string, that string will be appended to the <code>additionalArguments</code>, allowing you to configure
-     * arbitrary debug-ability options (without overwriting the other options specified through the <code>additionalArguments</code>
-     * parameter).
+     * Attach a debugger to the application JVM. If set to "true", the process will suspend and wait for a debugger to
+     * attach on port 5005. If set to some other string, that string will be appended to the
+     * <code>additionalArguments</code>, allowing you to configure arbitrary debug-ability options (without overwriting
+     * the other options specified through the <code>additionalArguments</code> parameter).
+     *
      * @since 3.11
      */
     @Parameter( property = "netbeans.run.params.debug" )
     protected String debugAdditionalArguments;
-    
+
     /**
      * The Maven Project.
      *
@@ -91,11 +92,12 @@
      * @throws MojoFailureException if an expected problem occurs
      */
     public void execute()
-        throws MojoExecutionException, MojoFailureException
+            throws MojoExecutionException, MojoFailureException
     {
         if ( !"nbm-application".equals( project.getPackaging() ) )
         {
-            throw new MojoFailureException( "The nbm:run-platform goal shall be used within a NetBeans Application project only ('nbm-application' packaging)" );
+            throw new MojoFailureException(
+                    "The nbm:run-platform goal shall be used within a NetBeans Application project only ('nbm-application' packaging)" );
         }
 
         netbeansUserdir.mkdirs();
@@ -105,7 +107,7 @@
         if ( !appbasedir.exists() )
         {
             throw new MojoExecutionException( "The directory that shall contain built application, doesn't exist ("
-                + appbasedir.getAbsolutePath() + ")\n Please invoke 'mvn install' on the project first" );
+                    + appbasedir.getAbsolutePath() + ")\n Please invoke 'mvn install' on the project first" );
         }
 
         boolean windows = Os.isFamily( "windows" );
@@ -130,8 +132,9 @@
                     [1] Mark Reinhold on 2017-09-25
                         https://twitter.com/mreinhold/status/912311207935090689
                     [2] Downloaded from https://www.azul.com/downloads/zulu/zulu-windows on 2018-09-05. */
-                    if ( !new File( jdkHome, "jre\\bin\\JavaAccessBridge-32.dll" ).exists() && // 32-bit Java 8
-                        !new File( jdkHome, "\\bin\\javaaccessbridge-32.dll" ).exists() ) // 32-bit Java 9 or 10
+                    if ( !new File( jdkHome, "jre\\bin\\JavaAccessBridge-32.dll" ).exists()
+                            && // 32-bit Java 8
+                            !new File( jdkHome, "\\bin\\javaaccessbridge-32.dll" ).exists() ) // 32-bit Java 9 or 10
                     {
                         File exec64 = new File( appbasedir, "bin\\" + brandingToken + "64.exe" );
                         if ( exec64.isFile() )
@@ -140,7 +143,10 @@
                         }
                     }
                 }
-                cmdLine.addArguments( new String[] { "--console", "suppress" } );
+                cmdLine.addArguments( new String[]
+                {
+                    "--console", "suppress"
+                } );
             }
         }
         else
@@ -190,7 +196,7 @@
 
     private String getDebugAdditionalArguments()
     {
-       if ( "true".equals( debugAdditionalArguments ) )
+        if ( "true".equals( debugAdditionalArguments ) )
         {
             return "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005";
         }
diff --git a/src/main/mdo/descriptor.mdo b/src/main/mdo/descriptor.mdo
index ad09568..2a1db00 100644
--- a/src/main/mdo/descriptor.mdo
+++ b/src/main/mdo/descriptor.mdo
@@ -49,7 +49,7 @@
                     <name>codeNameBase</name>
                     <version>1.0.0+</version>
                     <description>DEPRECATED, use the plugin configuration instead. Codenamebase of the module. Primary identification of the module. Usually the package name. Eg. "org.codehaus.mevenide.project". 
-                    If not defined here, the default value is constructed from groupId and artifactId.</description>
+                        If not defined here, the default value is constructed from groupId and artifactId.</description>
                     <type>String</type>
                     <annotations>
                         <annotation>@Deprecated</annotation>
@@ -77,7 +77,7 @@
                     <name>manifest</name>
                     <version>1.0.0+</version>
                     <description>DEPRECATED, use the plugin configuration instead. Location of the manifest file with NetBeans specific manifest entries.
-                        </description>
+                    </description>
                     <type>String</type>
                     <!--defaultValue>src/main/nbm/manifest.mf</defaultValue-->
                     <annotations>
@@ -135,13 +135,13 @@
                     <name>libraries</name>
                     <version>1.0.0+</version>
                     <description>groupId:artifactId of artifacts that shall become part of the module and be added on the classpath 
-                    (ClassPath: manifest entry gets created and the jar is included in the nbm file)</description>
+                        (ClassPath: manifest entry gets created and the jar is included in the nbm file)</description>
                     <association>
                         <type>String</type>
                         <multiplicity>*</multiplicity>
                     </association>
                 </field>
-                 <field>
+                <field>
                     <name>dependencies</name>
                     <description>DEPRECATED, use the plugin configuration instead. List of module dependencies. The plugin will use it to Generate the OpenIDE-Module-Module-Dependencies manifest entry.</description>
                     <version>1.0.0+</version>
diff --git a/src/main/resources/META-INF/plexus/components.xml b/src/main/resources/META-INF/plexus/components.xml
index 2e489fb..ab57ab4 100644
--- a/src/main/resources/META-INF/plexus/components.xml
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -15,92 +15,92 @@
 under the License.
 -->
 <component-set>
-  <components>
-    <!--component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>jar</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>jar</type>
-        <extension>jar</extension>
-      </configuration>
-    </component-->
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>nbm</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>nbm</type>
-        <extension>jar</extension>
-        <packaging>nbm</packaging>
-        <addedToClasspath>true</addedToClasspath>
-        <language>java</language>
-        <includesDependencies>true</includesDependencies>
-      </configuration>
-    </component>
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>nbm-file</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>nbm-file</type>
-        <extension>nbm</extension>
-        <packaging>nbm-file</packaging>
-        <addedToClasspath>false</addedToClasspath>
-        <language>java</language>
-        <includesDependencies>true</includesDependencies>
-      </configuration>
-    </component>
-    <component>
-      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
-      <role-hint>nbm-application</role-hint>
-      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
-      <configuration>
-        <type>nbm-application</type>
-        <extension>zip</extension>
-        <packaging>nbm-application</packaging>
-        <addedToClasspath>false</addedToClasspath>
-        <language>java</language>
-        <includesDependencies>false</includesDependencies>
-      </configuration>
-    </component>
+    <components>
+        <!--component>
+          <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+          <role-hint>jar</role-hint>
+          <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+          <configuration>
+            <type>jar</type>
+            <extension>jar</extension>
+          </configuration>
+        </component-->
+        <component>
+            <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+            <role-hint>nbm</role-hint>
+            <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+            <configuration>
+                <type>nbm</type>
+                <extension>jar</extension>
+                <packaging>nbm</packaging>
+                <addedToClasspath>true</addedToClasspath>
+                <language>java</language>
+                <includesDependencies>true</includesDependencies>
+            </configuration>
+        </component>
+        <component>
+            <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+            <role-hint>nbm-file</role-hint>
+            <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+            <configuration>
+                <type>nbm-file</type>
+                <extension>nbm</extension>
+                <packaging>nbm-file</packaging>
+                <addedToClasspath>false</addedToClasspath>
+                <language>java</language>
+                <includesDependencies>true</includesDependencies>
+            </configuration>
+        </component>
+        <component>
+            <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+            <role-hint>nbm-application</role-hint>
+            <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+            <configuration>
+                <type>nbm-application</type>
+                <extension>zip</extension>
+                <packaging>nbm-application</packaging>
+                <addedToClasspath>false</addedToClasspath>
+                <language>java</language>
+                <includesDependencies>false</includesDependencies>
+            </configuration>
+        </component>
     
-    <component>
-      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
-      <role-hint>nbm</role-hint>
-      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
-      <configuration>
-        <phases>
-          <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
-          <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
-          <process-classes>org.apache.netbeans.utilities:nbm-maven-plugin:manifest</process-classes>
-          <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
-          <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
-          <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
-          <package>org.apache.maven.plugins:maven-jar-plugin:jar, 
-                   org.apache.netbeans.utilities:nbm-maven-plugin:branding,
-                   org.apache.netbeans.utilities:nbm-maven-plugin:nbm
-          </package>
-          <install>org.apache.maven.plugins:maven-install-plugin:install</install>
-          <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
-        </phases>
-      </configuration>
-    </component>
+        <component>
+            <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+            <role-hint>nbm</role-hint>
+            <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+            <configuration>
+                <phases>
+                    <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
+                    <compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile>
+                    <process-classes>org.apache.netbeans.utilities:nbm-maven-plugin:manifest</process-classes>
+                    <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
+                    <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
+                    <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
+                    <package>org.apache.maven.plugins:maven-jar-plugin:jar, 
+                        org.apache.netbeans.utilities:nbm-maven-plugin:branding,
+                        org.apache.netbeans.utilities:nbm-maven-plugin:nbm
+                    </package>
+                    <install>org.apache.maven.plugins:maven-install-plugin:install</install>
+                    <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
+                </phases>
+            </configuration>
+        </component>
 
-    <component>
-      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
-      <role-hint>nbm-application</role-hint>
-      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
-      <configuration>
-        <phases>
-          <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
-          <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
-          <package>org.apache.netbeans.utilities:nbm-maven-plugin:cluster-app,org.apache.netbeans.utilities:nbm-maven-plugin:standalone-zip</package>
-          <integration-test>org.apache.maven.plugins:maven-surefire-plugin:test</integration-test>
-          <install>org.apache.maven.plugins:maven-install-plugin:install</install>
-          <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
-        </phases>
-      </configuration>
-    </component>
-  </components>
+        <component>
+            <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+            <role-hint>nbm-application</role-hint>
+            <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+            <configuration>
+                <phases>
+                    <process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources>
+                    <test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
+                    <package>org.apache.netbeans.utilities:nbm-maven-plugin:cluster-app,org.apache.netbeans.utilities:nbm-maven-plugin:standalone-zip</package>
+                    <integration-test>org.apache.maven.plugins:maven-surefire-plugin:test</integration-test>
+                    <install>org.apache.maven.plugins:maven-install-plugin:install</install>
+                    <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
+                </phases>
+            </configuration>
+        </component>
+    </components>
 </component-set>
diff --git a/src/main/resources/branding.jnlp b/src/main/resources/branding.jnlp
index 9185b59..4eadfa1 100644
--- a/src/main/resources/branding.jnlp
+++ b/src/main/resources/branding.jnlp
@@ -17,15 +17,17 @@
 -->
 <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
 <jnlp spec="1.0+" codebase="${jnlp.codebase}">
-  <information>
-      <title>${app.title}</title>
-      <vendor>${app.vendor}</vendor>
-      <description>${app.description}</description>
-  </information>
-  <security><all-permissions/></security>
-  <resources>
-    ${jnlp.branding.jars}
-    ${jnlp.resources}
-  </resources>
-  <component-desc/>
+    <information>
+        <title>${app.title}</title>
+        <vendor>${app.vendor}</vendor>
+        <description>${app.description}</description>
+    </information>
+    <security>
+        <all-permissions/>
+    </security>
+    <resources>
+        ${jnlp.branding.jars}
+        ${jnlp.resources}
+    </resources>
+    <component-desc/>
 </jnlp>
\ No newline at end of file
diff --git a/src/main/resources/master.jnlp b/src/main/resources/master.jnlp
index b6f4812..dbe7d81 100644
--- a/src/main/resources/master.jnlp
+++ b/src/main/resources/master.jnlp
@@ -17,26 +17,28 @@
 -->
 <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
 <jnlp spec="1.0+" codebase="${jnlp.codebase}" href="${master.jnlp.file.name}.jnlp">
-  <information>
-      <title>${app.title}</title>
-      <vendor>${app.vendor}</vendor>
-      <description>${app.description}</description>
-      <offline-allowed/>
-  </information>
-  <security><all-permissions/></security>
-  <resources>
-    <!-- The following property is needed when running with unsigned jars: -->
-    <property name="netbeans.jnlp.fixPolicy" value="${netbeans.jnlp.fixPolicy}"/>
-    <extension name="modules" href="modules.jnlp"/>
-    <java version="1.6+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="${netbeans.run.params}"/>
-    <jar href="startup.jar"/>
-    <property name="netbeans.user" value="${user.home}/.${branding.token}"/>
-  </resources>
-  <resources os="Mac OS X">
-      <property name="netbeans.user" value="${user.home}/Library/Application Support/${branding.token}"/>
-  </resources>
-  <application-desc>
-    <argument>--branding</argument>
-    <argument>${branding.token}</argument>
-  </application-desc>
+    <information>
+        <title>${app.title}</title>
+        <vendor>${app.vendor}</vendor>
+        <description>${app.description}</description>
+        <offline-allowed/>
+    </information>
+    <security>
+        <all-permissions/>
+    </security>
+    <resources>
+        <!-- The following property is needed when running with unsigned jars: -->
+        <property name="netbeans.jnlp.fixPolicy" value="${netbeans.jnlp.fixPolicy}"/>
+        <extension name="modules" href="modules.jnlp"/>
+        <java version="1.6+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="${netbeans.run.params}"/>
+        <jar href="startup.jar"/>
+        <property name="netbeans.user" value="${user.home}/.${branding.token}"/>
+    </resources>
+    <resources os="Mac OS X">
+        <property name="netbeans.user" value="${user.home}/Library/Application Support/${branding.token}"/>
+    </resources>
+    <application-desc>
+        <argument>--branding</argument>
+        <argument>${branding.token}</argument>
+    </application-desc>
 </jnlp> 
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
index ca5d8b0..a7b2c59 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -22,24 +22,24 @@
         <version>1.0-SNAPSHOT</version>
     </skin>  
     <body>
-    <menu name="Overview">
-      <item name="Usage" href="index.html"/>
-      <item name="Plugin Goals" href="plugin-info.html"/>
-      <!-- <item name="Javadoc" href="apidocs/index.html"/> -->
-      <!--item name="FAQ" href="faq.html"/-->
-    </menu>
-    <!--<menu name="Upgrade">   
-      <item name="2.4 -> 2.5 upgrade" href="2425upgrade.html"/>
-      <item name="2.6 -> 3.0 upgrade" href="2630upgrade.html"/>
-    </menu>-->
-    <menu name="HOWTOs ">
-      <item name="Customize installers" href="buildinstexample.html"/>
-      <item name="Upgrade from older versions" href="upgrade.html"/>
-    </menu>
-    <menu name="Deprecated">
-      <item name="Descriptor Format" href="nbm.html"/>
-      <item name="Example Descriptor" href="descriptor.html"/>
-    </menu>
-  </body>
+        <menu name="Overview">
+            <item name="Usage" href="index.html"/>
+            <item name="Plugin Goals" href="plugin-info.html"/>
+            <!-- <item name="Javadoc" href="apidocs/index.html"/> -->
+            <!--item name="FAQ" href="faq.html"/-->
+        </menu>
+        <!--<menu name="Upgrade">   
+          <item name="2.4 -> 2.5 upgrade" href="2425upgrade.html"/>
+          <item name="2.6 -> 3.0 upgrade" href="2630upgrade.html"/>
+        </menu>-->
+        <menu name="HOWTOs ">
+            <item name="Customize installers" href="buildinstexample.html"/>
+            <item name="Upgrade from older versions" href="upgrade.html"/>
+        </menu>
+        <menu name="Deprecated">
+            <item name="Descriptor Format" href="nbm.html"/>
+            <item name="Example Descriptor" href="descriptor.html"/>
+        </menu>
+    </body>
 </project>
 
diff --git a/src/test/java/org/apache/netbeans/nbm/AbstractNbmMojoTest.java b/src/test/java/org/apache/netbeans/nbm/AbstractNbmMojoTest.java
index 97d584f..28d1917 100644
--- a/src/test/java/org/apache/netbeans/nbm/AbstractNbmMojoTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/AbstractNbmMojoTest.java
@@ -18,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -42,203 +41,221 @@
  *
  * @author mkleint
  */
-public class AbstractNbmMojoTest extends TestCase {
+public class AbstractNbmMojoTest extends TestCase
+{
+
     Log log = null;
     DefaultDependencyNode treeRoot = null;
-    
-    public AbstractNbmMojoTest(String testName) {
-        super(testName);
+
+    public AbstractNbmMojoTest( String testName )
+    {
+        super( testName );
     }
 
     @Override
-    protected void setUp() throws Exception {
+    protected void setUp() throws Exception
+    {
         super.setUp();
         log = new SystemStreamLog();
-        treeRoot = createNode(null, "root", "root", "1.0", "jar", "", true, new ArrayList<Artifact>(), new HashMap<Artifact,ExamineManifest>());
+        treeRoot = createNode( null, "root", "root", "1.0", "jar", "", true, new ArrayList<Artifact>(), new HashMap<Artifact, ExamineManifest>() );
     }
 
     @Override
-    protected void tearDown() throws Exception {
+    protected void tearDown() throws Exception
+    {
         super.tearDown();
     }
 
     /**
      * Test of matchesLibrary method, of class AbstractNbmMojo.
      */
-    public void testMatchesLibrary() {
-        System.out.println("matchesLibrary");
-        Artifact artifact = createArtifact("group", "artifact", "1.0", "jar", "compile");
+    public void testMatchesLibrary()
+    {
+        System.out.println( "matchesLibrary" );
+        Artifact artifact = createArtifact( "group", "artifact", "1.0", "jar", "compile" );
         List<String> libraries = new ArrayList<String>();
-        libraries.add("group:artifact");
+        libraries.add( "group:artifact" );
         ExamineManifest depExaminator = createNonModule();
-        boolean result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertTrue("explicitly defined libraries in descriptor are included", result);
+        boolean result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertTrue( "explicitly defined libraries in descriptor are included", result );
 
-        artifact = createArtifact("group", "artifact", "1.0", "jar", "provided");
+        artifact = createArtifact( "group", "artifact", "1.0", "jar", "provided" );
         libraries = new ArrayList<String>();
-        result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertFalse("provided artifacts are not included", result);
+        result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertFalse( "provided artifacts are not included", result );
 
-        artifact = createArtifact("group", "artifact", "1.0", "jar", "system");
+        artifact = createArtifact( "group", "artifact", "1.0", "jar", "system" );
         libraries = new ArrayList<String>();
-        result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertFalse("system artifacts are not included", result);
+        result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertFalse( "system artifacts are not included", result );
 
-        artifact = createArtifact("group", "artifact", "1.0", "jar", "compile");
+        artifact = createArtifact( "group", "artifact", "1.0", "jar", "compile" );
         libraries = new ArrayList<String>();
-        libraries.add("group:artifact");
+        libraries.add( "group:artifact" );
         depExaminator = createModule();
-        result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertTrue("netbeans modules are included if explicitly marked in descriptor", result);
+        result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertTrue( "netbeans modules are included if explicitly marked in descriptor", result );
 
         libraries = new ArrayList<String>();
-        result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertFalse("netbeans modules are omitted", result);
+        result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertFalse( "netbeans modules are omitted", result );
 
-        artifact = createArtifact("group", "artifact", "1.0", "nbm", "compile");
+        artifact = createArtifact( "group", "artifact", "1.0", "nbm", "compile" );
         libraries = new ArrayList<String>();
-        result = AbstractNbmMojo.matchesLibrary(artifact, libraries, depExaminator, log, false);
-        assertFalse("netbeans modules are omitted", result);
+        result = AbstractNbmMojo.matchesLibrary( artifact, libraries, depExaminator, log, false );
+        assertFalse( "netbeans modules are omitted", result );
 
     }
 
     /**
      * Test of resolveNetBeansDependency method, of class AbstractNbmMojo.
      */
-    public void testResolveNetBeansDependency() {
-        Artifact artifact = createArtifact("group", "artifact", "1.0", "jar", "compile");
+    public void testResolveNetBeansDependency()
+    {
+        Artifact artifact = createArtifact( "group", "artifact", "1.0", "jar", "compile" );
         List<Dependency> deps = new ArrayList<Dependency>();
         ExamineManifest manifest = createNonModule();
-        Dependency result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertNull("not a NetBeans module", result);
+        Dependency result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertNull( "not a NetBeans module", result );
 
         manifest = createModule();
-        result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertNotNull("is a NetBeans module", result);
+        result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertNotNull( "is a NetBeans module", result );
 
-        artifact = createArtifact("group", "artifact", "1.0", "nbm", "compile");
+        artifact = createArtifact( "group", "artifact", "1.0", "nbm", "compile" );
         manifest = createNonModule();
-        result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertNotNull("nbm type is a NetBeans module", result);
+        result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertNotNull( "nbm type is a NetBeans module", result );
 
-
-        artifact = createArtifact("group", "artifact", "1.0", "jar", "compile");
+        artifact = createArtifact( "group", "artifact", "1.0", "jar", "compile" );
         deps = new ArrayList<Dependency>();
         Dependency d = new Dependency();
-        d.setId("group:artifact");
-        deps.add(d);
+        d.setId( "group:artifact" );
+        deps.add( d );
         manifest = createNonModule();
-        result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertNull("not a NetBeans module, declared in deps but without explicit value", result);
+        result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertNull( "not a NetBeans module, declared in deps but without explicit value", result );
 
-        d.setExplicitValue("XXX > 1.0");
-        result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertEquals("not a NetBeans module but declared with explicit value", result, d);
+        d.setExplicitValue( "XXX > 1.0" );
+        result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertEquals( "not a NetBeans module but declared with explicit value", result, d );
 
-        d.setExplicitValue(null);
+        d.setExplicitValue( null );
         manifest = createModule();
-        result = AbstractNbmMojo.resolveNetBeansDependency(artifact, deps, manifest, log);
-        assertEquals("netbeans module defined in descriptor", result, d);
+        result = AbstractNbmMojo.resolveNetBeansDependency( artifact, deps, manifest, log );
+        assertEquals( "netbeans module defined in descriptor", result, d );
     }
 
     /**
      * Module is not a library
+     *
      * @throws java.lang.Exception if AbstractNbmMojo.getLibraryArtifacts fail
      */
-    public void testGetLibraryArtifacts1() throws Exception {
-        System.out.println("getLibraryArtifacts1");
+    public void testGetLibraryArtifacts1() throws Exception
+    {
+        System.out.println( "getLibraryArtifacts1" );
         Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
         List<Artifact> runtimes = new ArrayList<Artifact>();
-        DependencyNode module = createNode(treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache);
-        treeRoot.setChildren( Collections.singletonList( module ));
+        DependencyNode module = createNode( treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache );
+        treeRoot.setChildren( Collections.singletonList( module ) );
         NetBeansModule mdl = new NetBeansModule();
-        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts(treeRoot, mdl, runtimes, examinerCache, log, false);
-        assertEquals(0, result.size());
+        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts( treeRoot, mdl, runtimes, examinerCache, log, false );
+        assertEquals( 0, result.size() );
     }
 
     /**
      * direct dependency is a library
+     *
      * @throws java.lang.Exception if AbstractNbmMojo.getLibraryArtifacts fail
      */
-    public void testGetLibraryArtifact2() throws Exception {
-        System.out.println("getLibraryArtifacts2");
+    public void testGetLibraryArtifact2() throws Exception
+    {
+        System.out.println( "getLibraryArtifacts2" );
         Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
         List<Artifact> runtimes = new ArrayList<Artifact>();
-        DependencyNode library = createNode(treeRoot, "gr1", "ar1", "1.0", "jar", "compile", false, runtimes, examinerCache);
-        treeRoot.setChildren( Collections.singletonList( library ));
+        DependencyNode library = createNode( treeRoot, "gr1", "ar1", "1.0", "jar", "compile", false, runtimes, examinerCache );
+        treeRoot.setChildren( Collections.singletonList( library ) );
         NetBeansModule mdl = new NetBeansModule();
-        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts(treeRoot, mdl, runtimes, examinerCache, log, false);
-        assertEquals(1, result.size());
+        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts( treeRoot, mdl, runtimes, examinerCache, log, false );
+        assertEquals( 1, result.size() );
     }
 
-    
     /**
      * transitive dependency gets included as well.
+     *
      * @throws java.lang.Exception if AbstractNbmMojo.getLibraryArtifacts fail
      */
-    public void testGetLibraryArtifact3() throws Exception {
-        System.out.println("getLibraryArtifacts3");
+    public void testGetLibraryArtifact3() throws Exception
+    {
+        System.out.println( "getLibraryArtifacts3" );
         Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
         List<Artifact> runtimes = new ArrayList<Artifact>();
-        DependencyNode library = createNode(treeRoot, "gr1", "ar1", "1.0", "jar", "compile", false, runtimes, examinerCache);
-        treeRoot.setChildren( Collections.singletonList( library ));
-        DependencyNode translibrary = createNode(library, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache);
-        ((DefaultDependencyNode)library).setChildren( Collections.singletonList( translibrary ) );
-        
+        DependencyNode library = createNode( treeRoot, "gr1", "ar1", "1.0", "jar", "compile", false, runtimes, examinerCache );
+        treeRoot.setChildren( Collections.singletonList( library ) );
+        DependencyNode translibrary = createNode( library, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache );
+        ( (DefaultDependencyNode) library ).setChildren( Collections.singletonList( translibrary ) );
+
         NetBeansModule mdl = new NetBeansModule();
-        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts(treeRoot, mdl, runtimes, examinerCache, log, false);
-        assertEquals(2, result.size());
+        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts( treeRoot, mdl, runtimes, examinerCache, log, false );
+        assertEquals( 2, result.size() );
     }
 
     /**
      * transitive dependency of a module doesn't get included as library
+     *
      * @throws java.lang.Exception if AbstractNbmMojo.getLibraryArtifacts fail
      */
-    public void testGetLibraryArtifact4() throws Exception {
-        System.out.println("getLibraryArtifacts4");
+    public void testGetLibraryArtifact4() throws Exception
+    {
+        System.out.println( "getLibraryArtifacts4" );
         Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
         List<Artifact> runtimes = new ArrayList<Artifact>();
-        DependencyNode module = createNode(treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache);
-        treeRoot.setChildren( Collections.singletonList( module ));
-        DependencyNode translibrary = createNode(module, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache);
-        ((DefaultDependencyNode)module).setChildren( Collections.singletonList( translibrary ) );
+        DependencyNode module = createNode( treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache );
+        treeRoot.setChildren( Collections.singletonList( module ) );
+        DependencyNode translibrary = createNode( module, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache );
+        ( (DefaultDependencyNode) module ).setChildren( Collections.singletonList( translibrary ) );
         NetBeansModule mdl = new NetBeansModule();
-        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts(treeRoot, mdl, runtimes, examinerCache, log, false);
-        assertEquals(0, result.size());
+        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts( treeRoot, mdl, runtimes, examinerCache, log, false );
+        assertEquals( 0, result.size() );
     }
 
     /**
-     * transitive dependency of a library is a duplicate of a transitive dependency of a module
-     * -&gt;doesn't get included.
+     * transitive dependency of a library is a duplicate of a transitive dependency of a module -&gt;doesn't get
+     * included.
+     *
      * @throws java.lang.Exception if AbstractNbmMojo.getLibraryArtifacts fail
      */
-    public void testGetLibraryArtifact5() throws Exception {
-        System.out.println("getLibraryArtifacts5");
+    public void testGetLibraryArtifact5() throws Exception
+    {
+        System.out.println( "getLibraryArtifacts5" );
         Map<Artifact, ExamineManifest> examinerCache = new HashMap<Artifact, ExamineManifest>();
         List<Artifact> runtimes = new ArrayList<Artifact>();
-        DependencyNode module = createNode(treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache);
-        DependencyNode translibrary = createNode(module, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache);
-        ((DefaultDependencyNode)module).setChildren( Collections.singletonList( translibrary ) );
+        DependencyNode module = createNode( treeRoot, "gr1", "ar1", "1.0", "jar", "compile", true, runtimes, examinerCache );
+        DependencyNode translibrary = createNode( module, "gr2", "ar2", "1.0", "jar", "runtime", false, runtimes, examinerCache );
+        ( (DefaultDependencyNode) module ).setChildren( Collections.singletonList( translibrary ) );
 
-        DependencyNode library = createNode(treeRoot, "gr3", "ar3", "1.0", "jar", "compile", false, runtimes, examinerCache);
-        DependencyNode translibrary2 = createNode(library, "gr4", "ar4", "1.0", "jar", "runtime", false, runtimes, examinerCache);
-        ((DefaultDependencyNode)library).setChildren( Collections.singletonList( translibrary2 ) );
-        treeRoot.setChildren( Arrays.asList( new DependencyNode[] { module, library}));
-
+        DependencyNode library = createNode( treeRoot, "gr3", "ar3", "1.0", "jar", "compile", false, runtimes, examinerCache );
+        DependencyNode translibrary2 = createNode( library, "gr4", "ar4", "1.0", "jar", "runtime", false, runtimes, examinerCache );
+        ( (DefaultDependencyNode) library ).setChildren( Collections.singletonList( translibrary2 ) );
+        treeRoot.setChildren( Arrays.asList( new DependencyNode[]
+        {
+            module, library
+        } ) );
 
         NetBeansModule mdl = new NetBeansModule();
-        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts(treeRoot, mdl, runtimes, examinerCache, log, false);
-        assertEquals(2, result.size());
-        assertEquals(result.get(0).getId(), library.getArtifact().getId());
-        assertEquals(result.get(1).getId(), translibrary2.getArtifact().getId());
+        List<Artifact> result = AbstractNbmMojo.getLibraryArtifacts( treeRoot, mdl, runtimes, examinerCache, log, false );
+        assertEquals( 2, result.size() );
+        assertEquals( result.get( 0 ).getId(), library.getArtifact().getId() );
+        assertEquals( result.get( 1 ).getId(), translibrary2.getArtifact().getId() );
     }
 
-    private DefaultDependencyNode createNode(DependencyNode parent, String gr, String art, String ver, String pack, String scope, boolean isModule, List<Artifact> runtimes, Map<Artifact, ExamineManifest> cache) {
-        Artifact a = createArtifact(gr, art, ver, pack, scope);
-        DefaultDependencyNode nd = new DefaultDependencyNode(parent, a, ver, scope, ver);
+    private DefaultDependencyNode createNode( DependencyNode parent, String gr, String art, String ver, String pack, String scope, boolean isModule, List<Artifact> runtimes, Map<Artifact, ExamineManifest> cache )
+    {
+        Artifact a = createArtifact( gr, art, ver, pack, scope );
+        DefaultDependencyNode nd = new DefaultDependencyNode( parent, a, ver, scope, ver );
         ExamineManifest manifest = isModule ? createModule() : createNonModule();
-        runtimes.add(a);
-        cache.put(a, manifest);
+        runtimes.add( a );
+        cache.put( a, manifest );
         nd.setChildren( Collections.<DependencyNode>emptyList() );
         return nd;
     }
@@ -247,24 +264,26 @@
 //        DependencyNode nd = new DefaultDependencyNode(a, state, a);
 //        return nd;
 //    }
-
-    private Artifact createArtifact(String gr, String art, String ver, String pack, String scope) {
-        VersionRange rng = VersionRange.createFromVersion(ver);
-        Artifact a = new DefaultArtifact(gr, art, rng, scope, pack, "classifier", null);
-        a.setDependencyTrail(Collections.EMPTY_LIST);
-        a.setFile(new File(gr + File.separator + art + File.separator + art + "-"+ ver + ".jar"));
+    private Artifact createArtifact( String gr, String art, String ver, String pack, String scope )
+    {
+        VersionRange rng = VersionRange.createFromVersion( ver );
+        Artifact a = new DefaultArtifact( gr, art, rng, scope, pack, "classifier", null );
+        a.setDependencyTrail( Collections.EMPTY_LIST );
+        a.setFile( new File( gr + File.separator + art + File.separator + art + "-" + ver + ".jar" ) );
         return a;
     }
 
-    private ExamineManifest createNonModule() {
-        ExamineManifest manifest = new ExamineManifest(log);
-        manifest.setNetBeansModule(false);
+    private ExamineManifest createNonModule()
+    {
+        ExamineManifest manifest = new ExamineManifest( log );
+        manifest.setNetBeansModule( false );
         return manifest;
     }
 
-    private ExamineManifest createModule() {
-        ExamineManifest manifest = new ExamineManifest(log);
-        manifest.setNetBeansModule(true);
+    private ExamineManifest createModule()
+    {
+        ExamineManifest manifest = new ExamineManifest( log );
+        manifest.setNetBeansModule( true );
         return manifest;
     }
 }
diff --git a/src/test/java/org/apache/netbeans/nbm/BrandingMojoTest.java b/src/test/java/org/apache/netbeans/nbm/BrandingMojoTest.java
index d514423..6be4cc2 100644
--- a/src/test/java/org/apache/netbeans/nbm/BrandingMojoTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/BrandingMojoTest.java
@@ -18,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 import java.io.File;
 import org.junit.Test;
 import static org.junit.Assert.*;
@@ -29,7 +28,7 @@
  */
 public class BrandingMojoTest
 {
-    
+
     public BrandingMojoTest()
     {
     }
@@ -47,16 +46,17 @@
         assertEquals( "path.1" + File.separator + "path.2" + File.separator + "cut_brandingToken", BrandingMojo.destinationFileName( "path.1" + File.separator + "path.2" + File.separator + "cut", "brandingToken" ) );
         assertEquals( "path.1" + File.separator + "cut_pressed_brandingToken.gif", BrandingMojo.destinationFileName( "path.1" + File.separator + "cut_pressed.gif", "brandingToken" ) );
     }
-    
+
     @Test
-    public void testLocale() {
-        assertEquals("en_us", BrandingMojo.getLocale( "aaa_en_us.properties")[1]);
-        assertEquals("en_us_ca", BrandingMojo.getLocale( "aaa_en_us_ca.properties")[1]);
-        assertEquals("en_us_ca", BrandingMojo.getLocale( "aa_en_us_ca.properties")[1]);
-        assertEquals("en_us_ca", BrandingMojo.getLocale( "bb_aa_en_us_ca.properties")[1]);
-        assertEquals("en", BrandingMojo.getLocale( "bb_aaa_en.properties")[1]);
-        assertEquals(null, BrandingMojo.getLocale( "bb_aaa_end.properties")[1]);
-        assertEquals(null, BrandingMojo.getLocale( "bb_aa_end.properties")[1]);
-        assertEquals(null, BrandingMojo.getLocale( "bb.properties")[1]);
+    public void testLocale()
+    {
+        assertEquals( "en_us", BrandingMojo.getLocale( "aaa_en_us.properties" )[1] );
+        assertEquals( "en_us_ca", BrandingMojo.getLocale( "aaa_en_us_ca.properties" )[1] );
+        assertEquals( "en_us_ca", BrandingMojo.getLocale( "aa_en_us_ca.properties" )[1] );
+        assertEquals( "en_us_ca", BrandingMojo.getLocale( "bb_aa_en_us_ca.properties" )[1] );
+        assertEquals( "en", BrandingMojo.getLocale( "bb_aaa_en.properties" )[1] );
+        assertEquals( null, BrandingMojo.getLocale( "bb_aaa_end.properties" )[1] );
+        assertEquals( null, BrandingMojo.getLocale( "bb_aa_end.properties" )[1] );
+        assertEquals( null, BrandingMojo.getLocale( "bb.properties" )[1] );
     }
 }
diff --git a/src/test/java/org/apache/netbeans/nbm/CreateClusterAppMojoTest.java b/src/test/java/org/apache/netbeans/nbm/CreateClusterAppMojoTest.java
index 65a7fba..f45d91b 100644
--- a/src/test/java/org/apache/netbeans/nbm/CreateClusterAppMojoTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/CreateClusterAppMojoTest.java
@@ -18,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -40,75 +39,104 @@
  */
 public class CreateClusterAppMojoTest
 {
-    
+
     public CreateClusterAppMojoTest()
     {
     }
-    
+
     @Test
-    public void computeClusterOrderingTest() throws Exception {
+    public void computeClusterOrderingTest() throws Exception
+    {
         HashMap<String, Set<String>> clusterDeps = new HashMap<String, Set<String>>();
         HashMap<String, Set<String>> clusterModules = new HashMap<String, Set<String>>();
-        clusterModules.put( "platform", new HashSet<String>(Arrays.asList( new String[] {"pl-a", "pl-b", "pl-c"})));
-        clusterModules.put( "ide", new HashSet<String>(Arrays.asList( new String[] {"i-a", "i-b", "i-c"})));
-        clusterModules.put( "java", new HashSet<String>(Arrays.asList( new String[] {"j-a", "j-b", "j-c"})));
-        
-        clusterDeps.put( "java", new HashSet<String>(Arrays.asList( new String[] {"i-a", "pl-b", "pl-c"})));
-        clusterDeps.put( "ide", new HashSet<String>(Arrays.asList( new String[] {"pl-b", "pl-c"})));
-        Map<String, Set<String>> res = CreateClusterAppMojo.computeClusterOrdering( clusterDeps, clusterModules);
+        clusterModules.put( "platform", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "pl-a", "pl-b", "pl-c"
+        } ) ) );
+        clusterModules.put( "ide", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "i-a", "i-b", "i-c"
+        } ) ) );
+        clusterModules.put( "java", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "j-a", "j-b", "j-c"
+        } ) ) );
+
+        clusterDeps.put( "java", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "i-a", "pl-b", "pl-c"
+        } ) ) );
+        clusterDeps.put( "ide", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "pl-b", "pl-c"
+        } ) ) );
+        Map<String, Set<String>> res = CreateClusterAppMojo.computeClusterOrdering( clusterDeps, clusterModules );
         assertNotNull( res );
-        Set<String> resJava = res.get( "java");
+        Set<String> resJava = res.get( "java" );
         assertNotNull( resJava );
-        assertEquals( resJava.size(), 2);
-        assertTrue( resJava.contains( "ide"));
-        assertTrue( resJava.contains( "platform"));
-        
-        Set<String> resIde = res.get( "ide");
+        assertEquals( resJava.size(), 2 );
+        assertTrue( resJava.contains( "ide" ) );
+        assertTrue( resJava.contains( "platform" ) );
+
+        Set<String> resIde = res.get( "ide" );
         assertNotNull( resIde );
-        assertEquals( resIde.size(), 1);
-        assertTrue( resIde.contains( "platform"));
-        
+        assertEquals( resIde.size(), 1 );
+        assertTrue( resIde.contains( "platform" ) );
+
     }
-    
+
     @Test
-    public void assignClustersToBundles() throws Exception {
+    public void assignClustersToBundles() throws Exception
+    {
         ArrayList<BundleTuple> bundles = new ArrayList<BundleTuple>();
-        BundleTuple tup1 = createBundleTuple("a.b.c", new File(getClass().getResource( "/osgimanifests" + File.separator + "a.b.c.MF").toURI()));
+        BundleTuple tup1 = createBundleTuple( "a.b.c", new File( getClass().getResource( "/osgimanifests" + File.separator + "a.b.c.MF" ).toURI() ) );
         bundles.add( tup1 );
-        BundleTuple tup2 = createBundleTuple("b.c.d", new File(getClass().getResource( "/osgimanifests" + File.separator + "b.c.d.MF").toURI()));
-        assertTrue(Arrays.toString( tup2.manifest.getOsgiImports().toArray()),  tup2.manifest.getOsgiImports().contains( "a.b.c"));
+        BundleTuple tup2 = createBundleTuple( "b.c.d", new File( getClass().getResource( "/osgimanifests" + File.separator + "b.c.d.MF" ).toURI() ) );
+        assertTrue( Arrays.toString( tup2.manifest.getOsgiImports().toArray() ), tup2.manifest.getOsgiImports().contains( "a.b.c" ) );
         bundles.add( tup2 );
         HashMap<String, Set<String>> clusterDeps = new HashMap<String, Set<String>>();
-        clusterDeps.put( "java", new HashSet<String>(Arrays.asList( new String[] {"i-a", "pl-b", "pl-c"})));
-        clusterDeps.put( "ide", new HashSet<String>(Arrays.asList( new String[] {"pl-b", "pl-c", "a.b.c"})));
-        
-        CreateClusterAppMojo.assignClustersToBundles(bundles, Collections.<String>emptySet(), clusterDeps, Collections.<String, Set<String>>emptyMap(), null);
-        assertEquals( "ide", tup1.cluster);
-        assertEquals( "ide", tup2.cluster);
-        
+        clusterDeps.put( "java", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "i-a", "pl-b", "pl-c"
+        } ) ) );
+        clusterDeps.put( "ide", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "pl-b", "pl-c", "a.b.c"
+        } ) ) );
+
+        CreateClusterAppMojo.assignClustersToBundles( bundles, Collections.<String>emptySet(), clusterDeps, Collections.<String, Set<String>>emptyMap(), null );
+        assertEquals( "ide", tup1.cluster );
+        assertEquals( "ide", tup2.cluster );
+
         clusterDeps.clear();
-        clusterDeps.put( "ide", new HashSet<String>(Arrays.asList( new String[] {"i-a", "pl-b", "pl-c"})));
-        clusterDeps.put( "java", new HashSet<String>(Arrays.asList( new String[] {"pl-b", "pl-c", "b.c.d"})));
+        clusterDeps.put( "ide", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "i-a", "pl-b", "pl-c"
+        } ) ) );
+        clusterDeps.put( "java", new HashSet<String>( Arrays.asList( new String[]
+        {
+            "pl-b", "pl-c", "b.c.d"
+        } ) ) );
         tup2.cluster = null;
         tup1.cluster = null;
-        
-        CreateClusterAppMojo.assignClustersToBundles(bundles, Collections.<String>emptySet(), clusterDeps, Collections.<String, Set<String>>emptyMap(), null);
-        assertEquals( "java", tup2.cluster);
-        assertEquals( "java", tup1.cluster);
-        
+
+        CreateClusterAppMojo.assignClustersToBundles( bundles, Collections.<String>emptySet(), clusterDeps, Collections.<String, Set<String>>emptyMap(), null );
+        assertEquals( "java", tup2.cluster );
+        assertEquals( "java", tup1.cluster );
+
     }
 
     private BundleTuple createBundleTuple( String cnb, File file ) throws MojoExecutionException
     {
-        assertTrue( file.exists());
-        
+        assertTrue( file.exists() );
+
         ExamineManifest em = new ExamineManifest( null );
         em.setManifestFile( file );
-        em.setPopulateDependencies( true);
+        em.setPopulateDependencies( true );
         em.checkFile();
-        assertEquals( cnb, em.getModule());
-        BundleTuple toRet = new BundleTuple( null, em);
-                
+        assertEquals( cnb, em.getModule() );
+        BundleTuple toRet = new BundleTuple( null, em );
+
         return toRet;
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java b/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java
index 65f0aff..8c89a27 100644
--- a/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/CreateNetBeansFileStructureTest.java
@@ -18,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -43,7 +42,7 @@
         ArtifactResolver artifactResolver = (ArtifactResolver) lookup( ArtifactResolver.class.getName() );
         Artifact a = artifactFactory.createBuildArtifact( "junit", "junit", "4.12", "jar" );
 //        DefaultArtifactRepository central = new DefaultArtifactRepository( "central", "http://repo.maven.apache.org/maven2", new DefaultRepositoryLayout() );
-        artifactResolver.resolve( a, Collections.<ArtifactRepository>emptyList(), new DefaultArtifactRepository( "local", new File(localRepository).toURI().toString(), new DefaultRepositoryLayout() ) );
+        artifactResolver.resolve( a, Collections.<ArtifactRepository>emptyList(), new DefaultArtifactRepository( "local", new File( localRepository ).toURI().toString(), new DefaultRepositoryLayout() ) );
         StringWriter w = new StringWriter();
         CreateNetBeansFileStructure.writeExternal( new PrintWriter( w ), a );
         assertEquals( "CRC:1355517765\nSIZE:314932\nURL:m2:/junit:junit:4.12:jar\nURL:http://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.jar\n", w.toString() );
diff --git a/src/test/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojoTest.java b/src/test/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojoTest.java
index 966b90b..3662fc1 100644
--- a/src/test/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojoTest.java
+++ b/src/test/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojoTest.java
@@ -18,7 +18,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
@@ -30,42 +29,49 @@
  *
  * @author mkleint
  */
-public class NetBeansManifestUpdateMojoTest extends TestCase {
-    
-    public NetBeansManifestUpdateMojoTest(String testName) {
-        super(testName);
+public class NetBeansManifestUpdateMojoTest extends TestCase
+{
+
+    public NetBeansManifestUpdateMojoTest( String testName )
+    {
+        super( testName );
     }
 
     public void testCreateCompiledPatternList()
     {
-        List<String> subpackages = Arrays.asList( new String[] {
-                "org.milos.**",
-                "org.tomas.**"
-        });
+        List<String> subpackages = Arrays.asList( new String[]
+        {
+            "org.milos.**",
+            "org.tomas.**"
+        } );
         List<Pattern> result = NetBeansManifestUpdateMojo.createCompiledPatternList( subpackages );
-        assertTrue( matches( "org.milos.Test", result));
-        assertTrue( matches( "org.milos.pack.Test", result));
-        assertTrue( matches( "org.tomas.pack.Test$Inside", result));
-        assertFalse( matches( "org.milan", result));
-        assertFalse( matches( "org.milosclass", result));
+        assertTrue( matches( "org.milos.Test", result ) );
+        assertTrue( matches( "org.milos.pack.Test", result ) );
+        assertTrue( matches( "org.tomas.pack.Test$Inside", result ) );
+        assertFalse( matches( "org.milan", result ) );
+        assertFalse( matches( "org.milosclass", result ) );
 
-        List<String> packages = Arrays.asList( new String[] {
-                "org.milos.*",
-                "org.tomas.*"
-        });
+        List<String> packages = Arrays.asList( new String[]
+        {
+            "org.milos.*",
+            "org.tomas.*"
+        } );
         result = NetBeansManifestUpdateMojo.createCompiledPatternList( packages );
-        assertTrue( matches( "org.milos.Test", result));
-        assertFalse( matches( "org.milos.pack.Test", result));
-        assertFalse( matches( "org.tomas.pack.Test$Inside", result));
-        assertTrue( matches( "org.tomas.Test$Inside", result));
-        assertFalse( matches( "org.milan", result));
-        assertFalse( matches( "org.milosclass", result));
+        assertTrue( matches( "org.milos.Test", result ) );
+        assertFalse( matches( "org.milos.pack.Test", result ) );
+        assertFalse( matches( "org.tomas.pack.Test$Inside", result ) );
+        assertTrue( matches( "org.tomas.Test$Inside", result ) );
+        assertFalse( matches( "org.milan", result ) );
+        assertFalse( matches( "org.milosclass", result ) );
 
     }
 
-    private boolean matches(String className, List<Pattern> matchers) {
-        for (Pattern patt : matchers) {
-            if (patt.matcher( className ).matches()) {
+    private boolean matches( String className, List<Pattern> matchers )
+    {
+        for ( Pattern patt : matchers )
+        {
+            if ( patt.matcher( className ).matches() )
+            {
                 return true;
             }
         }
@@ -78,12 +84,12 @@
         Locale.setDefault( Locale.US );
         try
         {
-            assertEquals( null, NetBeansManifestUpdateMojo.shorten ( null ) );
-            assertEquals( null, NetBeansManifestUpdateMojo.shorten ( "" ) );
-            assertEquals( "I typed some description here", NetBeansManifestUpdateMojo.shorten ( "I typed some description here" ) );
-            assertEquals( "Now I'm trying to be serious.", NetBeansManifestUpdateMojo.shorten ( "Now I'm trying to be serious." ) );
-            assertEquals( "A meaningful description.", NetBeansManifestUpdateMojo.shorten ( "A meaningful description. But will it work?" ) );
-            assertEquals( "I have no idea what this module does, do you?", NetBeansManifestUpdateMojo.shorten ( "I have no idea what this module does, do you? No? Fine." ) );
+            assertEquals( null, NetBeansManifestUpdateMojo.shorten( null ) );
+            assertEquals( null, NetBeansManifestUpdateMojo.shorten( "" ) );
+            assertEquals( "I typed some description here", NetBeansManifestUpdateMojo.shorten( "I typed some description here" ) );
+            assertEquals( "Now I'm trying to be serious.", NetBeansManifestUpdateMojo.shorten( "Now I'm trying to be serious." ) );
+            assertEquals( "A meaningful description.", NetBeansManifestUpdateMojo.shorten( "A meaningful description. But will it work?" ) );
+            assertEquals( "I have no idea what this module does, do you?", NetBeansManifestUpdateMojo.shorten( "I have no idea what this module does, do you? No? Fine." ) );
         }
         finally
         {
@@ -92,12 +98,12 @@
     }
 
     public void testNewlines()
-        throws Exception
+            throws Exception
     {
         Manifest m = new Manifest();
         Manifest.Section s = m.getMainSection();
         new NetBeansManifestUpdateMojo().conditionallyAddAttribute( s, "Desc", "Something.\n   Else.\n" );
-        assertEquals( "Something. Else.", s.getAttributeValue( "Desc" ));
+        assertEquals( "Something. Else.", s.getAttributeValue( "Desc" ) );
     }
 
 }