Checkstyle bracket and space rewrite
diff --git a/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java b/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
index 03c93c0..c106fb1 100644
--- a/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/AbstractNbmMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
@@ -216,25 +216,31 @@
         throws MojoExecutionException
     {
         List<Dependency> deps = new ArrayList<Dependency>();
-        if (customDependencies != null) {
-            deps.addAll( Arrays.asList( customDependencies ));
+        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");
+        if ( module != null && !module.getDependencies().isEmpty() )
+        {
+            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) {
-                    if (d2.getId().equals(d.getId())) {
+                for ( Dependency d2 : deps )
+                {
+                    if ( d2.getId().equals( d.getId() ) )
+                    {
                         found = d2;
                         break;
                     }
                 }
-                if (found != null) {
+                if ( found != null )
+                {
                     deps.remove( found );
                 }
-                deps.add(d);
+                deps.add( d );
             }
         }
         List<ModuleWrapper> include = new ArrayList<ModuleWrapper>();
@@ -395,15 +401,18 @@
                 // via WorkspaceReader. That's fine here, as all we need is to know if project is osgi or nbm module.
                 // the nbm file has to be in local repository though.
                 String path = localRepository.pathOf( art );
-                File jar2 = new File(localRepository.getBasedir(), path.replace( "/", File.separator));
-                File manifest = new File(jar, "META-INF/MANIFEST.MF" );
+                File jar2 = new File( localRepository.getBasedir(), path.replace( "/", File.separator ) );
+                File manifest = new File( jar, "META-INF/MANIFEST.MF" );
                 
-                if (! jar2.isFile() || !manifest.isFile() ) {
+                if ( !jar2.isFile() || !manifest.isFile() )
+                {
                     getLog().warn( "MNBMODULE-131: need to at least run install phase on " + jar2 );
                     return new ArtifactResult( null, null );
                 }
                 mnf.setManifestFile( manifest );
-            } else {
+            }
+            else
+            {
                 mnf.setJarFile( jar );
             }
             mnf.checkFile();
diff --git a/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java b/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
index dc7114e..f6bbe99 100644
--- a/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
+++ b/src/main/java/org/apache/netbeans/nbm/AdaptNbVersion.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.StringTokenizer;
@@ -67,7 +67,8 @@
                 if ( token.indexOf( '-' ) > 0 )
                 {
                     token = token.substring( 0, token.indexOf( '-' ) );
-                } else if ( token.indexOf( '_' ) > 0 )
+                } 
+                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 1fe0ac4..af01314 100644
--- a/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/BrandingMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -52,10 +52,10 @@
  *
  *
  */
-@Mojo(name="branding",
-        requiresProject=true,
+@Mojo( name = "branding",
+        requiresProject = true,
         threadSafe = true,
-        defaultPhase= LifecyclePhase.PACKAGE)
+        defaultPhase = LifecyclePhase.PACKAGE )
 public class BrandingMojo
         extends AbstractNbmMojo
 {
@@ -63,37 +63,37 @@
     /**
      * directory where the the binary content is created.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}/nbm")
+    @Parameter( required = true, defaultValue = "${project.build.directory}/nbm" )
     protected File nbmBuildDir;
     
     /**
     * output directory.
     */
-    @Parameter(defaultValue="${project.build.directory}", required=true)
+    @Parameter( defaultValue = "${project.build.directory}", required = true )
     protected File outputDirectory;
     
     /**
      * Location of the branded resources.
      */
-    @Parameter(required=true, defaultValue="${basedir}/src/main/nbm-branding")
+    @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.
      */
-    @Parameter(property="netbeans.branding.token")
+    @Parameter( property = "netbeans.branding.token" )
     private String brandingToken;
     /**
      * cluster of the branding.
      */
-    @Parameter(required=true, defaultValue="extra")
+    @Parameter( required = true, defaultValue = "extra" )
     protected String cluster;
     /**
      * @parameter expression="${project}"
      * @required
      * @readonly
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     public void execute()
@@ -125,7 +125,7 @@
             scanner.scan();
 
             final String clusterPathPart = "netbeans" + File.separator + cluster;
-            File outputDir = new File(outputDirectory, "branding_and_locales");
+            File outputDir = new File( outputDirectory, "branding_and_locales" );
             outputDir.mkdirs();
             File clusterDir = new File( nbmBuildDir, clusterPathPart );
             clusterDir.mkdirs();
@@ -134,20 +134,22 @@
             for ( String brandingFilePath : scanner.getIncludedFiles() )
             {
                 File brandingFile = new File( brandingSources, brandingFilePath );
-                String[] locale = getLocale( brandingFile.getName());
+                String[] locale = getLocale( brandingFile.getName() );
                 String token = locale[1] == null ? brandingToken : brandingToken + "_" + locale[1];
-                File root = new File(outputDir, token);
+                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()) {
-                if (!rootDir.isDirectory()) {
+            for ( File rootDir : outputDir.listFiles() ) 
+            {
+                if ( !rootDir.isDirectory() ) 
+                {
                     continue;
                 }
                 String effectiveBranding = rootDir.getName();
@@ -162,7 +164,7 @@
                 {
                     // move nnn.jar directory to nnn.jar.tmp
                     File jarDirectory = new File( rootDir, jarDirectoryPath );
-                    File destinationLocation = new File(clusterDir, jarDirectoryPath).getParentFile();
+                    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 =
@@ -192,7 +194,8 @@
 
         // no underscores, use dot
         int lastDot = brandingFilePath.lastIndexOf( "." );
-        if (lastDot == -1 || lastDot < lastSeparator) {
+        if ( lastDot == -1 || lastDot < lastSeparator )
+        {
             return brandingFilePath + infix;
         }
         return brandingFilePath.substring( 0, lastDot ) + infix + brandingFilePath.substring( lastDot );
@@ -201,26 +204,33 @@
     //[0] prefix
     //[1] locale
     //[2] suffix
-    static String[] getLocale(String name) {
+    static String[] getLocale( String name )
+    {
         String suffix = "";
-        int dot = name.indexOf( ".");
-        if (dot > -1) { //remove file extension
+        int dot = name.indexOf( "." );
+        if ( dot > -1 ) 
+        { //remove file extension
             suffix = name.substring( dot );
-            name = name.substring( 0, dot);
+            name = name.substring( 0, dot );
         }
         String locale = null;
         int count = 1;
         //iterate from back of the string, max 3 times and see if the pattern patches local pattern
-        while (count <= 3) {
-            int underscore = name.lastIndexOf( '_');
-            if (underscore > -1) {
-                String loc1 = name.substring( underscore  + 1);
-                if (loc1.length() != 2) {
+        while ( count <= 3 )
+        {
+            int underscore = name.lastIndexOf( '_' );
+            if ( underscore > -1 )
+            {
+                String loc1 = name.substring( underscore + 1 );
+                if ( loc1.length() != 2 )
+                {
                     break;
                 } 
-                locale = loc1 + (locale == null ? "" : "_" + locale);
-                name = name.substring( 0, underscore);
-            } else {
+                locale = loc1 + ( locale == null ? "" : "_" + locale );
+                name = name.substring( 0, underscore );
+            }
+            else
+            {
                 break;
             }
             count = count + 1;
diff --git a/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java b/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
index fe725ca..975bc43 100644
--- a/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/BuildInstallersMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,13 +19,23 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -46,11 +58,11 @@
  * <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, 
-        requiresDependencyResolution=ResolutionScope.RUNTIME,
+@Mojo( name = "build-installers", 
+        requiresProject = true, 
+        requiresDependencyResolution = ResolutionScope.RUNTIME,
         threadSafe = true,
-        defaultPhase=LifecyclePhase.PACKAGE )
+        defaultPhase = LifecyclePhase.PACKAGE )
 public class BuildInstallersMojo
         extends AbstractNbmMojo
 {
@@ -58,53 +70,53 @@
     /**
     * output directory.
     */
-    @Parameter(defaultValue="${project.build.directory}", required=true)
+    @Parameter( defaultValue = "${project.build.directory}", required = true )
     protected File outputDirectory;
     /**
     * The branding token for the application based on NetBeans platform.
     */
-    @Parameter(property="netbeans.branding.token", required=true)
+    @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.
     */
-    @Parameter(property="netbeans.branding.token")
+    @Parameter( property = "netbeans.branding.token" )
     protected String installDirName;
     /**
     * Prefix of all generated installers files
     */
-    @Parameter(defaultValue="${project.build.finalName}")
+    @Parameter( defaultValue = "${project.build.finalName}" )
     private String installersFilePrefix;
     /**
      * Create installer for Windows
      */
-    @Parameter(defaultValue="true")
+    @Parameter( defaultValue = "true" )
     private boolean installerOsWindows;
     /**
      * Create installer for Solaris
      */
-    @Parameter(defaultValue="true")
+    @Parameter( defaultValue = "true" )
     private boolean installerOsSolaris;
     /**
      * Create installer for Linux
      */
-    @Parameter(defaultValue="true")    
+    @Parameter( defaultValue = "true" )
     private boolean installerOsLinux;
     /**
      * Create installer for MacOSx
      */
-    @Parameter(defaultValue="true")    
+    @Parameter( defaultValue = "true" )
     private boolean installerOsMacosx;
     /**
      * Enable Pack200 compression
      */
-    @Parameter(defaultValue="true")
+    @Parameter( defaultValue = "true" )
     private boolean installerPack200Enable;
     /**
      * License file
      */
-    @Parameter(defaultValue="${basedir}/license.txt")
+    @Parameter( defaultValue = "${basedir}/license.txt" )
     private File installerLicenseFile;
     /**
      * Custom installer template.
@@ -125,7 +137,7 @@
     /**
      * Name of the zip artifact used to produce installers from (without .zip extension)
      */
-    @Parameter(defaultValue="${project.build.finalName}")
+    @Parameter( defaultValue = "${project.build.finalName}" )
     private String finalName;
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
@@ -135,13 +147,13 @@
     @Component
     private MavenProjectHelper projectHelper;
         
-    @Parameter(readonly=true, required=true, property="basedir")
+    @Parameter( readonly = true, required = true, property = "basedir" )
     private File basedir;
     /**
     * The Maven Project.
     */
-    @Parameter(required=true, readonly=true, property="project")    
-    private MavenProject project;    
+    @Parameter( required = true, readonly = true, property = "project" )
+    private MavenProject project;
 
     // </editor-fold>
     @Override
@@ -156,8 +168,9 @@
                     "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.");
+        if ( !installerOsLinux && !installerOsMacosx && !installerOsSolaris && !installerOsWindows )
+        {
+            getLog().warn( "None of the Operating System Installers selected, skipping 'build-installers' goal." );
             return;
         }
 
@@ -187,7 +200,7 @@
         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.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( "\\", "/" ) );
diff --git a/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java b/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
index 3504006..d7f5974 100644
--- a/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
+++ b/src/main/java/org/apache/netbeans/nbm/CollectLibrariesNodeVisitor.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
diff --git a/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java b/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
index 6d1a04f..d052658 100644
--- a/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
+++ b/src/main/java/org/apache/netbeans/nbm/CollectModuleLibrariesNodeVisitor.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -138,8 +138,8 @@
             if ( currentModule.size() > 0 )
             {
                 ////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 ) )
+                if ( !currentModule.peek().startsWith( LIB_ID )
+                        && AbstractNbmMojo.matchesLibrary( artifact, Collections.<String>emptyList(), depExaminator, log, useOSGiDependencies ) )
                 {
                     if ( currentModule.size() == 1 )
                     {
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
index 82e9dce..c5f0469 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,10 +19,19 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import com.google.common.collect.Sets;
-import java.io.*;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -78,11 +89,11 @@
  *
  * @author Milos Kleint
  */
-@Mojo(name="cluster-app", 
-        defaultPhase= LifecyclePhase.PACKAGE, 
-        requiresProject=true, 
+@Mojo( name = "cluster-app", 
+        defaultPhase = LifecyclePhase.PACKAGE,
+        requiresProject = true, 
         threadSafe = true,
-        requiresDependencyResolution= ResolutionScope.RUNTIME )
+        requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class CreateClusterAppMojo
     extends AbstractNbmMojo
 {
@@ -90,33 +101,33 @@
     /**
      * output directory where the the NetBeans application will be created.
      */
-    @Parameter(defaultValue="${project.build.directory}", required=true)
+    @Parameter( defaultValue = "${project.build.directory}", required = true )
     private File outputDirectory;
 
     /**
      * The Maven Project.
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     /**
      * The branding token for the application based on NetBeans platform.
      */
-    @Parameter(property="netbeans.branding.token", required=true)
+    @Parameter( property = "netbeans.branding.token", required = true )
     protected String brandingToken;
 
     /**
      * Optional path to custom etc/${brandingToken}.conf file. If not defined,
      * a default template will be used.
      */
-    @Parameter( property="netbeans.conf.file")
+    @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.
      */
-    @Parameter(property="netbeans.clusters.file")
+    @Parameter( property = "netbeans.clusters.file" )
     private File etcClustersFile;
 
     /**
@@ -125,7 +136,7 @@
      * 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")
+    @Parameter( property = "netbeans.bin.directory" )
     private File binDirectory;
 
     /**
@@ -133,7 +144,7 @@
      * use this value as default location for such module NBMs.
      * @since 3.2
      */
-    @Parameter(defaultValue="extra")
+    @Parameter( defaultValue = "extra" )
     private String defaultCluster;
     
     /**
@@ -141,13 +152,13 @@
      * and that all required tokens are provided
      * @since 3.10
      */
-    @Parameter(defaultValue = "true", property = "netbeans.verify.integrity")
+    @Parameter( defaultValue = "true", property = "netbeans.verify.integrity" )
     private boolean verifyIntegrity;
     
     /**
      * @since 4.12
      */
-    @Parameter(defaultValue ="org.netbeans", property = "groupIdPrefix")
+    @Parameter( defaultValue = "org.netbeans", property = "groupIdPrefix" )
     private String groupIdPrefix;
     
     private final Collection<String> defaultPlatformTokens = Arrays.asList( new String[] {
@@ -161,7 +172,7 @@
                     "org.openide.modules.ModuleFormat1",
                     "org.openide.modules.ModuleFormat2",
                     "org.openide.modules.jre.JavaFX" //MNBMODULE-234
-    });
+    } );
 
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
@@ -176,7 +187,7 @@
      * Local maven repository.
      *
      */
-    @Parameter(required=true, readonly=true, property="localRepository")
+    @Parameter( required = true, readonly = true, property = "localRepository" )
     protected ArtifactRepository localRepository;
 
 // end of component params custom code folding
@@ -197,21 +208,21 @@
         {
             Project antProject = registerNbmAntTasks();
 
-            Set<String> wrappedBundleCNBs = new HashSet<>(100);
+            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<>( 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
             
             List<BundleTuple> bundles = new ArrayList<>();
 
@@ -232,7 +243,7 @@
                         JarFile jf = new JarFile( art.getFile() );
                         try
                         {
-                            String clusterName = findCluster( jf );                            
+                            String clusterName = findCluster( jf );
                             ClusterTuple cluster = processCluster( clusterName, nbmBuildDirFile, art );
                             
                                 getLog().debug( "Copying " + art.getId() + " to cluster " + clusterName );
@@ -253,10 +264,12 @@
                                     JarEntry ent = enu.nextElement();
                                     String name = ent.getName();
                                     //MNBMODULE-176
-                                    if (name.equals("Info/executables.list")) {
-                                        if (cluster.newer) {
+                                    if ( name.equals( "Info/executables.list" ) )
+                                    {
+                                        if ( cluster.newer )
+                                        {
                                             InputStream is = jf.getInputStream( ent );
-                                            executables = StringUtils.split( IOUtil.toString( is, "UTF-8" ), "\n");
+                                            executables = StringUtils.split( IOUtil.toString( is, "UTF-8" ), "\n" );
                                         }
                                     }
                                     else if ( name.startsWith( "netbeans/" ) )
@@ -273,7 +286,7 @@
                                         {
                                             part = part.replace( ".jar.pack.gz", ".jar" );
                                         }
-                                        if (cluster.newer) 
+                                        if ( cluster.newer )
                                         {
                                             if ( ent.isDirectory() )
                                             {
@@ -339,7 +352,7 @@
                                             
                                             
                                             // now figure which one of the jars is the module jar..
-                                            if ( part.matches("(modules|core|lib)/[^/]+[.]jar") )
+                                            if ( part.matches( "(modules|core|lib)/[^/]+[.]jar" ) )
                                             {
                                                 ExamineManifest ex = new ExamineManifest( getLog() );
                                                 ex.setJarFile( fl );
@@ -348,33 +361,42 @@
                                                 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
+                                                    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 ( 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()));
+                                                    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( ".**")) {
+                                                        provideTokens.addAll( ex.getNetBeansProvidesTokens() );
+                                                        for ( String pack : ex.getPackages() )
+                                                        {
+                                                            if ( pack.endsWith( ".**" ) )
+                                                            {
                                                                 //what to do with subpackages?
-                                                                pack = pack.substring( 0, pack.length() - ".**".length());
+                                                                pack = pack.substring( 0, pack.length() - ".**".length() );
                                                                 osgiExportsSubs.add( pack );
-                                                            } else if (pack.endsWith( ".*")) {
-                                                                pack = pack.substring( 0, pack.length() - ".*".length());
-                                                                osgiExports.add(pack);                                                            
+                                                            } 
+                                                            else if ( pack.endsWith( ".*" ) )
+                                                            {
+                                                                pack = pack.substring( 0, pack.length() - ".*".length() );
+                                                                osgiExports.add( pack );
                                                             }
                                                         }
                                                         
@@ -383,38 +405,46 @@
                                             }
                                         }
                                     }
-                                    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) {
+                                    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()) {
+                                            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");
+                                            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") )
+                                            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 
+                                                }
+                                                else
                                                 {
-                                                    getLog().info(ex.getModule() + " added by " + art.getId() + "" + classpathFile);
-                                                    wrappedBundleCNBs.add(ex.getModule());
+                                                    getLog().info( ex.getModule() + " added by " + art.getId() + "" + classpathFile );
+                                                    wrappedBundleCNBs.add( ex.getModule() );
                                                 }
                                             }
                                         }
@@ -460,45 +490,58 @@
                 if ( res.isOSGiBundle() )
                 {
                     ExamineManifest ex = res.getExaminedManifest();
-                    bundles.add( new BundleTuple( art,  ex) );
-                    if (verifyIntegrity) {
-                        dependencyCNBs.addAll(ex.getDependencyTokens());
+                    bundles.add( new BundleTuple( art, ex ) );
+                    if ( verifyIntegrity ) 
+                    {
+                        dependencyCNBs.addAll( ex.getDependencyTokens() );
                         for ( String d : ex.getDependencyTokens() )
                         {
                             addToMap( dependencyCNBBacktraces, d, Collections.singletonList( ex.getModule() ) );
                         }
-                        modulesCNBs.add(ex.getModule());
-                        osgiImports.addAll( ex.getOsgiImports());
+                        modulesCNBs.add( ex.getModule() );
+                        osgiImports.addAll( ex.getOsgiImports() );
                         for ( String d : ex.getOsgiImports() )
                         {
                             addToMap( osgiImportsBacktraces, d, Collections.singletonList( ex.getModule() ) );
                         }
                         
-                        osgiExports.addAll( ex.getOsgiExports());
+                        osgiExports.addAll( ex.getOsgiExports() );
                     }
                 } 
             }
             
-            if (verifyIntegrity) {
-                if (getLog().isDebugEnabled()) {
-                    getLog().debug( "All found codenamebases:" + Arrays.toString( modulesCNBs.toArray()) );
-                    getLog().debug( "All found OSGI exports:" + Arrays.toString( osgiExports.toArray()) );
-                    getLog().debug( "All found provided tokens:" + Arrays.toString( provideTokens.toArray()) );
+            if ( verifyIntegrity )
+            {
+                if ( getLog().isDebugEnabled() )
+                {
+                    getLog().debug( "All found codenamebases:" + Arrays.toString( modulesCNBs.toArray() ) );
+                    getLog().debug( "All found OSGI exports:" + Arrays.toString( osgiExports.toArray() ) );
+                    getLog().debug( "All found provided tokens:" + Arrays.toString( provideTokens.toArray() ) );
                 }
                 dependencyCNBs.removeAll( modulesCNBs );
-                if (modulesCNBs.contains( "org.netbeans.modules.netbinox")) {
-                    dependencyCNBs.remove( "org.eclipse.osgi"); //this is special.
+                if ( modulesCNBs.contains( "org.netbeans.modules.netbinox" ) )
+                {
+                    dependencyCNBs.remove( "org.eclipse.osgi" ); //this is special.
                 }
                 osgiImports.removeAll( osgiExports );
                 Iterator<String> it = osgiImports.iterator();
-                while (it.hasNext()) {
+                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") || s.startsWith( "org.ietf.jgss")) {
+                    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();
                         continue;
                     }
-                    for (String sub : osgiExportsSubs) {
-                        if (s.startsWith( sub )) {
+                    for ( String sub : osgiExportsSubs )
+                    {
+                        if ( s.startsWith( sub ) )
+                        {
                             it.remove();
                             break;
                         }
@@ -506,50 +549,63 @@
                 }
                 requireTokens.removeAll( provideTokens );
                 requireTokens.removeAll( defaultPlatformTokens );
-                if (!dependencyCNBs.isEmpty() || !osgiImports.isEmpty() ||!requireTokens.isEmpty()) {
-                    if (!dependencyCNBs.isEmpty()) {
+                if ( !dependencyCNBs.isEmpty() || !osgiImports.isEmpty() || !requireTokens.isEmpty() )
+                {
+                    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:" );
-                        for (String s : dependencyCNBs) {
+                        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:");
-                        for (String s : osgiImports) {
+                    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:" );
+                        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:");
-                        for (String s : requireTokens) {
+                    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:" );
+                        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.");
-                } else {
-                    getLog().info( "Integrity verification passed.");
+                    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 {
-                getLog().info( "Integrity verification skipped.");
+                else
+                {
+                    getLog().info( "Integrity verification passed." );
+                }
             }
-            
+            else
+            {
+                getLog().info( "Integrity verification skipped." );
+            }
+
             //attempt to sort clusters based on the dependencies and cluster content.
             Map<String, Set<String>> cluster2depClusters = computeClusterOrdering( clusterDependencies, clusterModules );
             clusterModules.clear();
-        
+
             //now assign the cluster to bundles based on dependencies..
             assignClustersToBundles( bundles, wrappedBundleCNBs, clusterDependencies, cluster2depClusters, getLog() );
-            
-            
-            for (BundleTuple ent : bundles) {
+
+
+            for ( BundleTuple ent : bundles )
+            {
                 Artifact art = ent.artifact;
                 final ExamineManifest ex = ent.manifest;
-                
+
                 String clstr = ent.cluster;
-                if (clstr == null) {
+                if ( clstr == null )
+                {
                     clstr = defaultCluster;
                 }
                 
@@ -572,14 +628,16 @@
                     {
                         FileUtils.copyFile( art.getFile(), moduleArt );
                         final File moduleConf = new File( confModules, cnbDashed + ".xml" );
-                        FileUtils.copyStreamToFile( new InputStreamFacade() {
+                        FileUtils.copyStreamToFile( new InputStreamFacade()
+                        {
                             @Override
                             public InputStream getInputStream() throws IOException
                             {
                                 return new StringInputStream( createBundleConfigFile( cnb, ex.isBundleAutoload() ), "UTF-8" );
                             }
                         }, moduleConf );
-                        FileUtils.copyStreamToFile( new InputStreamFacade() {
+                        FileUtils.copyStreamToFile( new InputStreamFacade()
+                        {
                             @Override
                             public InputStream getInputStream() throws IOException
                             {
@@ -634,7 +692,7 @@
                 "Cannot process etc folder content creation.", ex );
         }
     }
-    private final static Pattern patt = Pattern.compile(
+    private static final Pattern PATT = Pattern.compile(
         ".*targetcluster=\"([a-zA-Z0-9_\\.\\-]+)\".*", Pattern.DOTALL );
 
     private String findCluster( JarFile jf )
@@ -643,7 +701,7 @@
         ZipEntry entry = jf.getEntry( "Info/info.xml" );
         InputStream ins = jf.getInputStream( entry );
         String str = IOUtil.toString( ins, "UTF8" );
-        Matcher m = patt.matcher( str );
+        Matcher m = PATT.matcher( str );
         if ( !m.matches() )
         {
             getLog().info( "Cannot find cluster for " + jf.getName() + " Falling back to default value - '"
@@ -811,12 +869,13 @@
             else
             {
                 File nbm = getHarnessNbm();
-                try (ZipFile zip = new ZipFile( nbm )) {
+                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 );
+                    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 );
                 }
             }
         }
@@ -961,21 +1020,24 @@
         @SuppressWarnings( "unchecked" )
         Set<Artifact> artifacts = project.getArtifacts();
         String version = null;
-        for (Artifact a : artifacts) {
-            if ( (groupIdPrefix + ".modules").equals(a.getGroupId()) && "org-netbeans-bootstrap".equals(a.getArtifactId())) {
+        for ( Artifact a : artifacts )
+        {
+            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;
             }
         }
-        if (version == null) {
-            throw new MojoExecutionException( "We could not find org-netbeans-bootstrap among the modules in the application. Launchers could not be found.");
+        if ( version == null )
+        {
+            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");
+            "nbm-file" );
         try
         {
             artifactResolver.resolve( nbmArt, project.getRemoteArtifactRepositories(), localRepository );
@@ -991,21 +1053,24 @@
     private void writeFromZip( final ZipFile zip, String zipPath, File destFile, boolean mandatory ) throws MojoExecutionException, IOException
     {
         final ZipEntry path = zip.getEntry( zipPath );
-        if (path == null) {
-            if (mandatory) {
-                throw new MojoExecutionException( zipPath + " not found in " + zip.getName());
+        if ( path == null )
+        {
+            if ( mandatory )
+            {
+                throw new MojoExecutionException( zipPath + " not found in " + zip.getName() );
             }
-            getLog().debug(zipPath + " is not present in " + zip.getName());
+            getLog().debug( zipPath + " is not present in " + zip.getName() );
             return;
         }
-        FileUtils.copyStreamToFile( new InputStreamFacade() {
+        FileUtils.copyStreamToFile( new InputStreamFacade()
+        {
             
             @Override
             public InputStream getInputStream() throws IOException
             {
                 return zip.getInputStream( path );
             }
-        }, destFile);
+        }, destFile );
     }
 
     private static void addToMap( Map<String, Set<String>> map, String clusterName, List<String> newValues )
@@ -1022,14 +1087,14 @@
         }
     }
     
-    private static List<String> findByDependencies( Map<String, Set<String>> clusterDependencies, String spec)
+    private static List<String> findByDependencies( Map<String, Set<String>> clusterDependencies, String spec )
     {
         List<String> toRet = new ArrayList<>();
         for ( Map.Entry<String, Set<String>> entry : clusterDependencies.entrySet() )
         {
             if ( entry.getValue().contains( spec ) )
             {
-                toRet.add(entry.getKey());
+                toRet.add( entry.getKey() );
             }
         }
         return toRet;
@@ -1043,7 +1108,7 @@
     //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<>();
@@ -1063,42 +1128,51 @@
                 it.remove();
                 continue;
             }
-            List<String> depclusters = findByDependencies(clusterDependencies, spec);
-            if (depclusters.size() == 1) {
+            List<String> depclusters = findByDependencies( clusterDependencies, spec );
+            if ( depclusters.size() == 1 )
+            {
                 ent.cluster = depclusters.get( 0 );
                 known.add( ent );
-            } else if (depclusters.isEmpty()) {
-                toProcess.add(ent);
-            } else {
+            }
+            else if ( depclusters.isEmpty() )
+            {
+                toProcess.add( ent );
+            }
+            else 
+            {
                 //more results.. from 2 dependent clusters pick the one that is lower in the stack.
                 for ( Iterator<String> it2 = depclusters.iterator(); it2.hasNext(); )
                 {
                     String s = it2.next();
                     Set<String> depsCs = cluster2depClusters.get( s );
                     boolean removeS = false;
-                    for (String sDep : depclusters) {
-                        if (s.equals( sDep) ) {
+                    for ( String sDep : depclusters )
+                    {
+                        if ( s.equals( sDep ) )
+                        {
                             continue;
                         }
-                        if (depsCs != null && depsCs.contains( sDep ) ) {
+                        if ( depsCs != null && depsCs.contains( sDep ) )
+                        {
                             removeS = true;
                         }
                     }
-                    if (removeS) {
+                    if ( removeS )
+                    {
                         it2.remove();
                     }
                 }
                 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())
+        if ( !toProcess.isEmpty() )
         {
-            walkKnownBundleDependenciesDown(known, toProcess);
+            walkKnownBundleDependenciesDown( known, toProcess );
         }
-        if (!toProcess.isEmpty())
+        if ( !toProcess.isEmpty() )
         {
-            walkKnownBundleDependenciesUp(known, toProcess);
+            walkKnownBundleDependenciesUp( known, toProcess );
         }
     }
 
@@ -1109,31 +1183,35 @@
         {
             BundleTuple bundleTuple = it.next();
             boolean found = false;
-            for ( BundleTuple knownBT : known)
+            for ( BundleTuple knownBT : known )
             {
-                Sets.SetView<String> is = Sets.intersection(bundleTuple.manifest.getOsgiExports() , knownBT.manifest.getOsgiImports() );
-                if (!is.isEmpty()) {
+                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiExports() , knownBT.manifest.getOsgiImports() );
+                if ( !is.isEmpty() )
+                {
                     found = true;
                     bundleTuple.cluster = knownBT.cluster;
                     break;
                 }
                 //dependencyTokens are requireBundle - matches the module property
-                is = Sets.intersection(Collections.singleton( bundleTuple.manifest.getModule()), new HashSet(knownBT.manifest.getDependencyTokens()) );
-                if (!is.isEmpty()) {
+                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) {
+            if ( found )
+            {
                 atLeastOneWasFound = true;
                 it.remove();
-                known.add(bundleTuple);
+                known.add( bundleTuple );
             }
             
         }
-        if (!toProcess.isEmpty() && atLeastOneWasFound) {
+        if ( !toProcess.isEmpty() && atLeastOneWasFound )
+        {
             walkKnownBundleDependenciesDown( known, toProcess );
         }
     }
@@ -1145,34 +1223,39 @@
         {
             BundleTuple bundleTuple = it.next();
             boolean found = false;
-            for ( BundleTuple knownBT : known)
+            for ( BundleTuple knownBT : known )
             {
-                Sets.SetView<String> is = Sets.intersection(bundleTuple.manifest.getOsgiImports() , knownBT.manifest.getOsgiExports() );
-                if (!is.isEmpty()) {
+                Sets.SetView<String> is = Sets.intersection( bundleTuple.manifest.getOsgiImports() , knownBT.manifest.getOsgiExports() );
+                if ( !is.isEmpty() )
+                {
                     found = true;
                     bundleTuple.cluster = knownBT.cluster;
                     break;
                 }
                 //dependencyTokens are requireBundle - matches the module property
-                is = Sets.intersection(Collections.singleton( knownBT.manifest.getModule()), new HashSet(bundleTuple.manifest.getDependencyTokens()) );
-                if (!is.isEmpty()) {
+                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) {
+            if ( found )
+            {
                 atLeastOneWasFound = true;
                 it.remove();
-                known.add(bundleTuple);
+                known.add( bundleTuple );
             }
             
         }
-        if (!toProcess.isEmpty() && atLeastOneWasFound) {
+        if ( !toProcess.isEmpty() && atLeastOneWasFound )
+        {
             walkKnownBundleDependenciesDown( known, toProcess );
         }
-        if (!toProcess.isEmpty() && atLeastOneWasFound) {
+        if ( !toProcess.isEmpty() && atLeastOneWasFound )
+        {
             walkKnownBundleDependenciesUp( known, toProcess );
         }
     }
@@ -1185,12 +1268,15 @@
         {
             String cluster = entry.getKey();
             Set<String> deps = entry.getValue();
-            for (Map.Entry<String, Set<String>> subEnt : clusterModules.entrySet()) {
-                if (subEnt.getKey().equals( cluster) ) {
+            for ( Map.Entry<String, Set<String>> subEnt : clusterModules.entrySet() )
+            {
+                if ( subEnt.getKey().equals( cluster ) )
+                {
                     continue;
                 }
-                Sets.SetView<String> is = Sets.intersection(subEnt.getValue(), deps );
-                if (!is.isEmpty()) {
+                Sets.SetView<String> is = Sets.intersection( subEnt.getValue(), deps );
+                if ( !is.isEmpty() )
+                {
                     addToMap( cluster2depClusters, cluster, Collections.singletonList( subEnt.getKey() ) );
                 }
             }
@@ -1198,7 +1284,8 @@
         return cluster2depClusters;
     }
     
-    static class BundleTuple {
+    static class BundleTuple
+    {
         final Artifact artifact;
         final ExamineManifest manifest;
         String cluster;
@@ -1223,18 +1310,18 @@
         }
     }
 
-    static String createBundleConfigFile( String cnb, boolean autoload)
+    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";
+"<?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 )
@@ -1242,13 +1329,13 @@
     {
 
         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>";
+"<?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>";
 
     }
 
@@ -1256,7 +1343,8 @@
         throws FileNotFoundException, IOException
     {
         CRC32 crc = new CRC32();
-        try (InputStream inFileStream = new FileInputStream( inFile )) {
+        try ( InputStream inFileStream = new FileInputStream( inFile ) )
+        {
             byte[] array = new byte[(int) inFile.length()];
             int len = inFileStream.read( array );
             if ( len != array.length )
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
index a3bd99f..3903d41 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateClusterMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -45,7 +45,7 @@
  * Semi-deprecated; used only for standalone modules and "suites".
  * @author Milos Kleint
  */
-@Mojo(name="cluster",aggregator=true, requiresDependencyResolution= ResolutionScope.RUNTIME )
+@Mojo( name = "cluster", aggregator = true, requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class CreateClusterMojo
         extends AbstractNbmMojo
 {
@@ -53,7 +53,7 @@
     /**
      * directory where the the NetBeans cluster will be created.
      */
-    @Parameter(defaultValue="${project.build.directory}/netbeans_clusters", required=true)
+    @Parameter( defaultValue = "${project.build.directory}/netbeans_clusters", required = true )
     protected File nbmBuildDir;
 
     /**
@@ -61,12 +61,12 @@
      * typically OSGi bundles
      * @since 3.2
      */
-    @Parameter(defaultValue="extra")
+    @Parameter( defaultValue = "extra" )
     private String defaultCluster;
     /**
      * If the executed project is a reactor project, this will contains the full list of projects in the reactor.
      */
-    @Parameter(required=true, readonly=true, property="reactorProjects")
+    @Parameter( required = true, readonly = true, property = "reactorProjects" )
     private List<MavenProject> reactorProjects;
 
     public void execute()
@@ -151,13 +151,15 @@
                         {
                             FileUtils.copyFile( jar, moduleArt );
                             final File moduleConf = new File( confModules, cnbDashed + ".xml" );
-                            FileUtils.copyStreamToFile( new InputStreamFacade() {
+                            FileUtils.copyStreamToFile( new InputStreamFacade()
+                            {
                                 public InputStream getInputStream() throws IOException
                                 {
                                     return new StringInputStream( CreateClusterAppMojo.createBundleConfigFile( cnb, mnf.isBundleAutoload() ), "UTF-8" );
                                 }
                             }, moduleConf );
-                            FileUtils.copyStreamToFile( new InputStreamFacade() {
+                            FileUtils.copyStreamToFile( new InputStreamFacade()
+                            {
                                 public InputStream getInputStream() throws IOException
                                 {
                                     return new StringInputStream( CreateClusterAppMojo.createBundleUpdateTracking( cnb, moduleArt, moduleConf, specVer ), "UTF-8" );
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
index 3c0265e..fbc0e50 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateNbmMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
@@ -57,11 +57,11 @@
  *
  * @author Milos Kleint
  */
-@Mojo(name="nbm", 
-        requiresProject=true, 
+@Mojo( name = "nbm",
+        requiresProject = true,
         threadSafe = true,
-        requiresDependencyResolution= ResolutionScope.RUNTIME, 
-        defaultPhase= LifecyclePhase.PACKAGE )
+        requiresDependencyResolution = ResolutionScope.RUNTIME,
+        defaultPhase = LifecyclePhase.PACKAGE )
 public class CreateNbmMojo
         extends CreateNetBeansFileStructure
         implements Contextualizable
@@ -70,17 +70,17 @@
     /**
      * keystore location for signing the nbm file
      */
-    @Parameter(property="keystore")
+    @Parameter( property = "keystore" )
     private String keystore;
     /**
      * keystore password
      */
-    @Parameter(property="keystorepass")
+    @Parameter( property = "keystorepass" )
     private String keystorepassword;
     /**
      * keystore alias
      */
-    @Parameter(property="keystorealias")
+    @Parameter( property = "keystorealias" )
     private String keystorealias;
 
     /**
@@ -88,14 +88,14 @@
      * If skipped, just the expanded directory for cluster is created
      * @since 3.0
      */
-    @Parameter(defaultValue="false", property="maven.nbm.skip")
+    @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")
+    @Parameter( defaultValue = "false" )
     private boolean requiresRestart;
     
     /**
@@ -104,14 +104,14 @@
      * information about the functionality. 
      * @since 3.8
      */
-    @Parameter(defaultValue="${project.url}")
+    @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}")
+    @Parameter( defaultValue = "${project.organization.name}" )
     private String author;
     
     /**
@@ -138,7 +138,7 @@
      * it's assumed to be the flat structure and the value is just the URL.
      * 
      */
-    @Parameter(property="maven.nbm.distributionURL")
+    @Parameter( property = "maven.nbm.distributionURL" )
     private String distributionUrl;
     
     /**
@@ -176,7 +176,7 @@
     // end of component params custom code folding
     // </editor-fold>
     
-    private 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
@@ -204,15 +204,17 @@
 
         nbmTask.setModule( "modules" + File.separator + moduleJarName + ".jar" );
         boolean reqRestart = requiresRestart;
-        if (!reqRestart && module.isRequiresRestart()) {
+        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) {
+        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 )
@@ -238,14 +240,16 @@
         }
         String licName = licenseName;
         File licFile = licenseFile;
-        if (module.getLicenseName() != null) {
+        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) {
+        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 )
@@ -273,8 +277,9 @@
             lb.addText( createDefaultLicenseText() );
         }
         String hpUrl = homePageUrl;
-        if (module.getHomepageUrl() != null) {
-            getLog().warn( "Module descriptor's homePageUrl field is deprecated, use plugin's configuration in pom.xml");
+        if ( module.getHomepageUrl() != null )
+        {
+            getLog().warn( "Module descriptor's homePageUrl field is deprecated, use plugin's configuration in pom.xml" );
             hpUrl = module.getHomepageUrl();
         }
         if ( hpUrl != null )
@@ -282,9 +287,10 @@
             nbmTask.setHomepage( hpUrl );
         }
         String distribUrl = distributionUrl;
-        if (module.getDistributionUrl() != null) {
+        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 )
         {
@@ -322,7 +328,7 @@
             nbmTask.setTargetcluster( cluster );
         }
         //MNBMODULE-217 avoid using the static DATE_FORMAT variable in MavenNBM.java (in ant harness)
-        nbmTask.setReleasedate( DATE_FORMAT.format(new Date(System.currentTimeMillis())) );
+        nbmTask.setReleasedate( DATE_FORMAT.format( new Date( System.currentTimeMillis() ) ) );
         try
         {
             nbmTask.execute();
@@ -343,6 +349,7 @@
         }
     }
 
+    @Override
     public void contextualize( Context context )
             throws ContextException
     {
@@ -353,55 +360,70 @@
     {
         String organization = "";
         Organization org = project.getOrganization();
-        if (org != null) {
+        if ( org != null )
+        {
             organization = org.getName();
-}
-        if (organization == null) {
+        }
+        if ( organization == null )
+        {
             List devs = project.getDevelopers();
-            if (devs.size() > 0) {
+            if ( devs.size() > 0 )
+            {
                 Iterator dvs = devs.iterator();
                 String devsString = "";
-                while (dvs.hasNext()) {
-                    Developer d = ( Developer )dvs.next();
+                while ( dvs.hasNext() )
+                {
+                    Developer d = ( Developer ) dvs.next();
                     devsString = devsString + "," + d.getName() != null ? d.getName() : d.getId();
                 }
-                organization = devsString.substring( 1 );    
+                organization = devsString.substring( 1 );
             }
         }
-        if (organization == null) {
+        if ( organization == null )
+        {
             organization = ""; //what's a good default value?
         }
         String date = "";
-        if (project.getInceptionYear() != null) {
+        if ( project.getInceptionYear() != null )
+        {
             date = project.getInceptionYear();
         }
-        String year = Integer.toString( Calendar.getInstance().get( Calendar.YEAR ));
-        if (!year.equals( date ) ) {
+        String year = Integer.toString( Calendar.getInstance().get( Calendar.YEAR ) );
+        if ( !year.equals( date ) )
+        {
             date = date.length() == 0 ? year : date + "-" + year;
         }
         return "Copyright " + organization + " " + date;
     }
     
-    private String createDefaultLicenseText() {
+    private String createDefaultLicenseText()
+    {
         String toRet = "License terms:\n";
         
         List licenses = project.getLicenses();
-        if (licenses != null && licenses.size() > 0) {
+        if ( licenses != null && licenses.size() > 0 )
+        {
             Iterator lic = licenses.iterator();
-            while (lic.hasNext()) {
-                License ll = ( License )lic.next();
+            while ( lic.hasNext() )
+            {
+                License ll = ( License ) lic.next();
                 
-                if (ll.getName() != null) {
+                if ( ll.getName() != null )
+                {
                    toRet = toRet + ll.getName() + " - "; 
                 }
-                if (ll.getUrl() != null) {
+                if ( ll.getUrl() != null )
+                {
                     toRet = toRet + ll.getUrl();
                 }
-                if (lic.hasNext()) {
+                if ( lic.hasNext() )
+                {
                     toRet = toRet + ",\n";
                 }
             }
-        } else {
+        }
+        else
+        {
            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 2cdaf33..c99323b 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateNetBeansFileStructure.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,9 +19,13 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -29,7 +35,6 @@
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
@@ -82,29 +87,29 @@
      * 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")
+    @Parameter( defaultValue = "${project.build.directory}/nbm", property = "maven.nbm.buildDir" )
     protected File nbmBuildDir;
     /**
      * Build directory
      */
-    @Parameter(required=true, readonly=true, property="project.build.directory")
+    @Parameter( required = true, readonly = true, property = "project.build.directory" )
     protected File buildDir;
     /**
      * Name of the jar packaged by the jar:jar plugin
      */
-    @Parameter(alias="jarname", property="project.build.finalName")
+    @Parameter( alias = "jarname", property = "project.build.finalName" )
     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
      */
-    @Parameter(defaultValue="${basedir}/src/main/nbm/module.xml")
+    @Parameter( defaultValue = "${basedir}/src/main/nbm/module.xml" )
     protected File descriptor;
     /**
      * NetBeans module's cluster. Replaces the cluster element in module descriptor.
      *
      */
-    @Parameter(required=true, defaultValue="extra")
+    @Parameter( required = true, defaultValue = "extra" )
     protected String cluster;
     /**
      * The location of JavaHelp sources for the project. The documentation
@@ -115,10 +120,10 @@
      * @since 2.7
      */
     @Deprecated
-    @Parameter(defaultValue="${basedir}/src/main/javahelp")
+    @Parameter( defaultValue = "${basedir}/src/main/javahelp" )
     protected File nbmJavahelpSource;
 
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     protected MavenProject project;
 
     /**
@@ -148,7 +153,7 @@
      *
      * @since 3.2
      */
-    @Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}")
+    @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
     
     protected String encoding;
     
@@ -176,7 +181,7 @@
      * 
      * @since 3.8
      */ 
-    @Parameter(defaultValue="normal")
+    @Parameter( defaultValue = "normal" )
     protected String moduleType;
     
     /**
@@ -185,7 +190,7 @@
      * 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}")
+    @Parameter( defaultValue = "${project.groupId}.${project.artifactId}" )
     private String codeNameBase;
     
     /**
@@ -203,7 +208,7 @@
     @Component
     protected MavenResourcesFiltering mavenResourcesFiltering;
 
-    @Parameter(property="session", readonly=true, required=true)
+    @Parameter( property = "session", readonly = true, required = true )
     protected MavenSession session;
 
 
@@ -213,6 +218,7 @@
     protected File clusterDir;
     protected String moduleJarName;
 
+    @Override
     public void execute()
             throws MojoExecutionException, MojoFailureException
     {
@@ -220,27 +226,31 @@
         if ( descriptor != null && descriptor.exists() )
         {
             module = readModuleDescriptor( descriptor );
-        } else
+        }
+        else
         {
             module = createDefaultDescriptor( project, false );
         }
         //same moduleType related code in NetBeansManifestUpdateMojo.java
         String type = moduleType;
-        if ("normal".equals(type) && module.getModuleType() != null) {
+        if ( "normal".equals( type ) && module.getModuleType() != null )
+        {
             type = module.getModuleType();
-            getLog().warn( "moduleType in module descriptor is deprecated, use the plugin's parameter moduleType");
+            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)) {
-            getLog().error( "Only 'normal,autoload,eager,disabled' are allowed values in the moduleType parameter");
+        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" );
         }
         boolean autoload = "autoload".equals( type );
         boolean eager = "eager".equals( type );
         boolean disabled = "disabled".equals( type );
         // 1. initialization
         String moduleName = codeNameBase;
-        if (module.getCodeNameBase() != null) {
+        if ( module.getCodeNameBase() != null )
+        {
             moduleName = module.getCodeNameBase();
-            getLog().warn( "codeNameBase in module descriptor is deprecated, use the plugin's parameter codeNameBase");
+            getLog().warn( "codeNameBase in module descriptor is deprecated, use the plugin's parameter codeNameBase" );
         }
         moduleName = NetBeansManifestUpdateMojo.stripVersionFromCodebaseName( moduleName.replaceAll( "-", "." ) );
         moduleJarName = moduleName.replace( '.', '-' );
@@ -325,7 +335,7 @@
         if ( module != null )
         {
             // copy libraries to the designated place..
-            @SuppressWarnings("unchecked")
+            @SuppressWarnings( "unchecked" )
             List<Artifact> artifacts = project.getRuntimeArtifacts();
             for ( Artifact artifact : artifacts )
             {
@@ -343,7 +353,7 @@
                     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 );
@@ -376,14 +386,14 @@
         if ( nbmJavahelpSource.exists() )
         {
             getLog().warn( "src/main/javahelp/ deprecated; use @HelpSetRegistration instead" );
-            File javahelp_target = new File( buildDir, "javahelp" );
+            File javahelpTarget = new File( buildDir, "javahelp" );
             String javahelpbase = moduleJarName.replace( '-', File.separatorChar ) + File.separator + "docs";
             String javahelpSearch = "JavaHelpSearch";
-            File b = new File( javahelp_target, javahelpbase );
+            File b = new File( javahelpTarget, javahelpbase );
             File p = new File( b, javahelpSearch );
             p.mkdirs();
             Copy cp = (Copy) antProject.createTask( "copy" );
-            cp.setTodir( javahelp_target );
+            cp.setTodir( javahelpTarget );
             FileSet set = new FileSet();
             set.setDir( nbmJavahelpSource );
             cp.addFileset( set );
@@ -412,7 +422,7 @@
             Jar jar = (Jar) antProject.createTask( "jar" );
             jar.setDestFile( new File( helpJarLocation, moduleJarName + ".jar" ) );
             set = new FileSet();
-            set.setDir( javahelp_target );
+            set.setDir( javahelpTarget );
             jar.addFileset( set );
             jar.execute();
         }
@@ -562,11 +572,11 @@
             clazz = Class.forName( "com.sun.java.help.search.HTMLIndexerKit" );
             fld = clazz.getDeclaredField( "defaultParser" );
             fld.setAccessible( true );
-            fld.set( null, null);
+            fld.set( null, null );
 
             fld = clazz.getDeclaredField( "defaultCallback" );
             fld.setAccessible( true );
-            fld.set( null, null);
+            fld.set( null, null );
 
         }
         catch ( IllegalArgumentException ex )
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
index 63a7c08..4d66894 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateStandaloneMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -35,7 +35,7 @@
  * @author Johan Andrén
  * @author Milos Kleint
  */
-@Mojo(name="standalone-zip", requiresProject=true, threadSafe = true)
+@Mojo( name = "standalone-zip", requiresProject = true, threadSafe = true )
 public class CreateStandaloneMojo
         extends AbstractMojo
 {
@@ -43,22 +43,22 @@
     /**
      * The branding token for the application based on NetBeans platform.
      */
-    @Parameter(property="netbeans.branding.token", required=true)
+    @Parameter( property = "netbeans.branding.token", required = true )
     protected String brandingToken;
     /**
      * output directory where the the NetBeans application will be created.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}")
+    @Parameter( required = true, defaultValue = "${project.build.directory}" )
     private File outputDirectory;
     /**
      * Name of the zip artifact produced by the goal (without .zip extension)
      */
-    @Parameter(defaultValue="${project.build.finalName}")
+    @Parameter( defaultValue = "${project.build.finalName}" )
     private String finalName;
     /**
      * The Maven project.
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     /**
@@ -66,6 +66,7 @@
      * @throws MojoExecutionException if an unexpected problem occurs
      * @throws MojoFailureException if an expected problem occurs
      */
+    @Override
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
diff --git a/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java b/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
index a25bfab..d6901bf 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateUpdateSiteMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.util.Iterator;
 import java.util.List;
@@ -59,10 +59,10 @@
  * @author Milos Kleint
  *
  */
-@Mojo(name="autoupdate", 
-        defaultPhase= LifecyclePhase.PACKAGE, 
-        aggregator=true, 
-        requiresDependencyResolution= ResolutionScope.RUNTIME )
+@Mojo( name = "autoupdate", 
+        defaultPhase = LifecyclePhase.PACKAGE, 
+        aggregator = true, 
+        requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class CreateUpdateSiteMojo
         extends AbstractNbmMojo
         implements Contextualizable
@@ -71,12 +71,12 @@
     /**
      * output directory.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}")
+    @Parameter( required = true, defaultValue = "${project.build.directory}" )
     protected File outputDirectory;
     /**
      * autoupdate site xml file name.
      */
-    @Parameter( defaultValue="updates.xml", property="maven.nbm.updatesitexml")
+    @Parameter( defaultValue = "updates.xml", property = "maven.nbm.updatesitexml" )
     protected String fileName;
     /**
      * A custom distribution base for the nbms in the update site.
@@ -100,20 +100,20 @@
      * 
      * @since 3.0 it's also possible to add remote repository as base
      */
-    @Parameter(defaultValue=".", property="maven.nbm.customDistBase")
+    @Parameter( defaultValue = ".", property = "maven.nbm.customDistBase" )
     private String distBase;
 
     /**
      * The Maven Project.
      *
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     /**
      * If the executed project is a reactor project, this will contains the full list of projects in the reactor.
      */
-    @Parameter(required=true, readonly=true, defaultValue="${reactorProjects}")
+    @Parameter( required = true, readonly = true, defaultValue = "${reactorProjects}" )
     private List reactorProjects;
     
     /**
@@ -148,7 +148,7 @@
      * Local maven repository.
      *
      */
-    @Parameter(readonly=true, required=true, defaultValue="${localRepository}")
+    @Parameter( readonly = true, required = true, defaultValue = "${localRepository}" )
     protected ArtifactRepository localRepository;
 
     // </editor-fold>
@@ -188,7 +188,8 @@
             Set<Artifact> artifacts = project.getArtifacts();
             for ( Artifact art : artifacts )
             {
-                if (!matchesIncludes(art)) {
+                if ( !matchesIncludes( art ) )
+                {
                     continue;
                 }
                 ArtifactResult res =
@@ -387,6 +388,7 @@
         return repo;
     }
 
+    @Override
     public void contextualize( Context context )
         throws ContextException
     {
@@ -395,13 +397,16 @@
 
     private boolean matchesIncludes( Artifact art )
     {
-        if (updateSiteIncludes != null) {
+        if ( updateSiteIncludes != null )
+        {
             String s = art.getGroupId() + ":" + art.getArtifactId();
-            for (String p : updateSiteIncludes) {
+            for ( String p : updateSiteIncludes )
+            {
                 //TODO optimize and only do once per execution.
-                p = p.replace(".", "\\.").replace( "*", ".*");
+                p = p.replace( ".", "\\." ).replace( "*", ".*" );
                 Pattern patt = Pattern.compile( p );
-                if (patt.matcher( s).matches()) {
+                if ( patt.matcher( s ).matches() )
+                {
                     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 1d56477..e3e3cd4 100644
--- a/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/CreateWebstartAppMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.File;
@@ -67,7 +67,7 @@
  * @author Milos Kleint
  * @since 3.0
  */
-@Mojo(name="webstart-app", defaultPhase= LifecyclePhase.PACKAGE )
+@Mojo( name = "webstart-app", defaultPhase = LifecyclePhase.PACKAGE )
 public class CreateWebstartAppMojo
     extends AbstractNbmMojo
 {
@@ -76,7 +76,7 @@
      * The Maven project.
 
      */
-    @org.apache.maven.plugins.annotations.Parameter(required=true, readonly=true, property="project")
+    @org.apache.maven.plugins.annotations.Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     @Component
@@ -85,34 +85,34 @@
     /**
      * The branding token for the application based on NetBeans platform.
      */
-    @org.apache.maven.plugins.annotations.Parameter(required=true, property="netbeans.branding.token")
+    @org.apache.maven.plugins.annotations.Parameter( required = true, property = "netbeans.branding.token" )
     protected String brandingToken;
 
     /**
      * output directory where the the NetBeans application will be created.
      */
-    @org.apache.maven.plugins.annotations.Parameter(required=true, defaultValue="${project.build.directory}")
+    @org.apache.maven.plugins.annotations.Parameter( required = true, defaultValue = "${project.build.directory}" )
     private File outputDirectory;
 
     /**
      * 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")
+    @org.apache.maven.plugins.annotations.Parameter( defaultValue = "webstart", property = "nbm.webstart.classifier" )
     private String webstartClassifier;
 
     /**
      * Codebase value within *.jnlp files.
      * <strong>Defining this parameter is generally a bad idea.</strong>
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="nbm.webstart.codebase")
+    @org.apache.maven.plugins.annotations.Parameter( property = "nbm.webstart.codebase" )
     private String codebase;
 
     /**
@@ -140,32 +140,32 @@
      * Defaults to the branding token.
      * @since 3.5
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="master.jnlp.file.name")
+    @org.apache.maven.plugins.annotations.Parameter( property = "master.jnlp.file.name" )
     private String masterJnlpFileName;
 
     /**
      * keystore location for signing the nbm file
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="keystore")
+    @org.apache.maven.plugins.annotations.Parameter( property = "keystore" )
     private String keystore;
 
     /**
      * keystore password
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="keystorepass")
+    @org.apache.maven.plugins.annotations.Parameter( property = "keystorepass" )
     private String keystorepassword;
 
     /**
      * keystore alias
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="keystorealias")
+    @org.apache.maven.plugins.annotations.Parameter( property = "keystorealias" )
     private String keystorealias;
 
     /**
      * keystore type
      * @since 3.5
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="keystoretype")
+    @org.apache.maven.plugins.annotations.Parameter( property = "keystoretype" )
     private String keystoretype;
 
     /**
@@ -177,14 +177,14 @@
      * 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")
+    @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.
      */
-    @org.apache.maven.plugins.annotations.Parameter(property="netbeans.run.params")
+    @org.apache.maven.plugins.annotations.Parameter( property = "netbeans.run.params" )
     private String additionalArguments;
 
     /**
@@ -203,7 +203,7 @@
         }
         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 )
         {
@@ -457,7 +457,8 @@
                     {
                         continue;
                     }
-                    archiver.addResource( new PlexusIoResource() {
+                    archiver.addResource( new PlexusIoResource()
+                    {
                         public @Override InputStream getContents() throws IOException
                         {
                             return new ByteArrayInputStream( FileUtils.fileRead( jnlp, "UTF-8" ).replace( localCodebase, "$$codebase" ).getBytes( "UTF-8" ) );
@@ -508,20 +509,21 @@
             if ( servlet.isFile() )
             {
                 archiver.addFile( servlet, "WEB-INF/lib/jnlp-servlet.jar" );
-                archiver.addResource( new PlexusIoResource() {
+                archiver.addResource( new PlexusIoResource()
+                {
                     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()
                     {
@@ -670,7 +672,7 @@
             String codenamebase = attr.getValue( "OpenIDE-Module" );
             if ( codenamebase == null )
             {
-                codenamebase = attr.getValue("Bundle-SymbolicName");
+                codenamebase = attr.getValue( "Bundle-SymbolicName" );
             }
             if ( codenamebase == null )
             {
@@ -678,9 +680,10 @@
             }
             
             // see http://hg.netbeans.org/main-silver/rev/87823abb86d9
-            if (codenamebase.equals("org.objectweb.asm.all")
-                    && jar.getParentFile().getName().equals("core")
-                    && jar.getParentFile().getParentFile().getName().startsWith("platform")) {
+            if ( codenamebase.equals( "org.objectweb.asm.all" )
+                    && jar.getParentFile().getName().equals( "core" )
+                    && jar.getParentFile().getParentFile().getName().startsWith( "platform" ) )
+            {
                 continue;
             }
             {
diff --git a/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java b/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
index ba751cb..f0d9cb0 100644
--- a/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/NetBeansManifestUpdateMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -86,11 +86,11 @@
  *
  * @author Milos Kleint
  */
-@Mojo(name="manifest", 
-        defaultPhase= LifecyclePhase.PROCESS_CLASSES, 
-        requiresProject=true, 
+@Mojo( name = "manifest",
+        defaultPhase = LifecyclePhase.PROCESS_CLASSES,
+        requiresProject = true,
         threadSafe = true,
-        requiresDependencyResolution= ResolutionScope.RUNTIME )
+        requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class NetBeansManifestUpdateMojo
     extends AbstractNbmMojo
 {
@@ -99,20 +99,20 @@
      * 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")
+    @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
      */
-    @Parameter(defaultValue="${basedir}/src/main/nbm/module.xml")
+    @Parameter( defaultValue = "${basedir}/src/main/nbm/module.xml" )
     protected File descriptor;
 
     /**
      * maven project
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     /**
@@ -123,7 +123,7 @@
      * Obsolete as of NetBeans 7.0 with &#64;HelpSetRegistration.
      * @since 2.7
      */
-    @Parameter(defaultValue="${basedir}/src/main/javahelp")
+    @Parameter( defaultValue = "${basedir}/src/main/javahelp" )
     protected File nbmJavahelpSource;
 
     /**
@@ -131,14 +131,14 @@
      * will not be overwritten
      * @since 3.0
      */
-    @Parameter(required=true, defaultValue="${basedir}/src/main/nbm/manifest.mf")
+    @Parameter( required = true, defaultValue = "${basedir}/src/main/nbm/manifest.mf" )
     private File sourceManifestFile;
 
     /**
      * 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")
+    @Parameter( required = true, readonly = true, defaultValue = "${project.build.outputDirectory}/META-INF/MANIFEST.MF" )
     private File targetManifestFile;
 
     /**
@@ -150,7 +150,7 @@
      *
      * @since 3.0
      */
-    @Parameter(property="maven.nbm.verify", defaultValue="fail")
+    @Parameter( property = "maven.nbm.verify", defaultValue = "fail" )
     private String verifyRuntime;
     
     private static final String FAIL = "fail";
@@ -180,7 +180,7 @@
      *
      * @since 3.2
      */
-    @Parameter(defaultValue="false")
+    @Parameter( defaultValue = "false" )
     private boolean useOSGiDependencies;
     
     /**
@@ -189,7 +189,7 @@
      * 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}")
+    @Parameter( defaultValue = "${project.groupId}.${project.artifactId}" )
     private String codeNameBase;
     
     /**
@@ -241,8 +241,8 @@
      * 
      * @since 3.8 (3.14 in manifest goal)
      */ 
-    @Parameter(defaultValue="normal")
-    protected String moduleType;    
+    @Parameter( defaultValue = "normal" )
+    protected String moduleType;
 
     // <editor-fold defaultstate="collapsed" desc="Component parameters">
 
@@ -250,7 +250,7 @@
      * The artifact repository to use.
 
      */
-    @Parameter(required=true, readonly=true, defaultValue="${localRepository}")
+    @Parameter( required = true, readonly = true, defaultValue = "${localRepository}" )
     private ArtifactRepository localRepository;
 
     /**
@@ -295,7 +295,7 @@
         if ( descriptor != null && descriptor.exists() )
         {
             module = readModuleDescriptor( descriptor );
-            getLog().warn( "descriptor parameter is deprecated, use equivalent mojo parameters instead.");
+            getLog().warn( "descriptor parameter is deprecated, use equivalent mojo parameters instead." );
         }
         else
         {
@@ -304,21 +304,24 @@
         
         String mtype = moduleType;
         //same moduleType related code in CreateNetBeansFileStructure.java
-        if ("normal".equals(mtype) && module.getModuleType() != null) {
+        if ( "normal".equals( mtype ) && module.getModuleType() != null )
+        {
             mtype = module.getModuleType();
-            getLog().warn( "moduleType in module descriptor is deprecated, use the plugin's parameter moduleType");
+            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)) {
-            getLog().error( "Only 'normal,autoload,eager,disabled' are allowed values in the moduleType parameter");
+        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) {
+        if ( module.getCodeNameBase() != null )
+        {
             moduleName = module.getCodeNameBase();
-            getLog().warn( "codeNameBase in module descriptor is deprecated, use the plugin's parameter codeNameBase");
+            getLog().warn( "codeNameBase in module descriptor is deprecated, use the plugin's parameter codeNameBase" );
         }
         moduleName = moduleName.replaceAll( "-", "." );
 //<!-- if a NetBeans specific manifest is defined, examine this one, otherwise the already included one.
@@ -382,8 +385,9 @@
             "OpenIDE-Module-Specification-Version", specVersion );
         conditionallyAddAttribute( mainSection,
             "OpenIDE-Module-Implementation-Version", implVersion );
-        if (autoload || eager) { //MNBMODULE-194
-            conditionallyAddAttribute( mainSection, "AutoUpdate-Show-In-Client", "false");
+        if ( autoload || eager )
+        { //MNBMODULE-194
+            conditionallyAddAttribute( mainSection, "AutoUpdate-Show-In-Client", "false" );
         }
         final String timestamp = createTimestamp( date );
         conditionallyAddAttribute( mainSection, "OpenIDE-Module-Build-Version",
@@ -395,7 +399,8 @@
             StringBuilder sb = new StringBuilder();
             for ( String pub : publicPackages )
             {
-                if (pub == null) { //#MNBMODULE-237
+                if ( pub == null )
+                { //#MNBMODULE-237
                     continue;
                 }
                 if ( pub.endsWith( ".**" ) )
@@ -414,10 +419,13 @@
                 }
                 sb.append( ", " );
             }
-            if (sb.length() > 1) { //if only item is null, we have empty builder
+            if ( sb.length() > 1 )
+            { //if only item is null, we have empty builder
                 sb.setLength( sb.length() - 2 ); //cut the last 2 ", " characters
                 packagesValue = sb.toString();
-            } else {
+            }
+            else
+            {
                 // no packages available
                 packagesValue = "-";
             }
@@ -461,20 +469,25 @@
 
             for ( Artifact a : libArtifacts )
             {
-                if (classPath.length() > 0)
+                if ( classPath.length() > 0 )
                 {
-                    classPath.append(' ');
+                    classPath.append( ' ' );
                 }
-                classPath.append(artifactToClassPathEntry( a, codeNameBase ));
+                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( a.getGroupId() ).
+                        append( ':' ).
+                        append( a.getArtifactId() ).
+                        append( ':' ).
+                        append( a.getBaseVersion() );
+                
+                if ( a.getClassifier() != null ) 
                 {
-                    mavenClassPath.append(":").append(a.getClassifier());
-            }
+                    mavenClassPath.append( ":" ).append( a.getClassifier() );
+                }
             }
 
             for ( ModuleWrapper wr : moduleArtifacts )
@@ -545,14 +558,14 @@
             if ( nbmJavahelpSource.exists() )
             {
                 String moduleJarName = stripVersionFromCodebaseName( moduleName ).replace( ".", "-" );
-                classPath.append( " docs/").append( moduleJarName ).append( ".jar" );
+                classPath.append( " docs/" ).append( moduleJarName ).append( ".jar" );
             }
 
             if ( classPath.length() > 0 )
             {
                 conditionallyAddAttribute( mainSection, "X-Class-Path", classPath.toString().trim() );
             }
-            if ( mavenClassPath.length() > 0)
+            if ( mavenClassPath.length() > 0 )
             {
                 conditionallyAddAttribute( mainSection, "Maven-Class-Path", mavenClassPath.toString() );
             }
@@ -594,7 +607,7 @@
     //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();
     }
 
     /**
@@ -633,7 +646,7 @@
         {
             attr = new Manifest.Attribute();
             attr.setName( key );
-            attr.setValue( value != null ? value.replaceAll("\\s+", " ").trim() : "<undefined>" );
+            attr.setValue( value != null ? value.replaceAll( "\\s+", " " ).trim() : "<undefined>" );
             try
             {
                 section.addConfiguredAttribute( attr );
@@ -712,7 +725,7 @@
                         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");
+                        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 );
@@ -823,7 +836,7 @@
 
     private Set<String>[] visibleModuleClasses( List<Artifact> moduleLibraries,
         ExamineManifest manifest, Dependency dep, String projectCodeNameBase,
-        boolean transitive)
+        boolean transitive )
         throws IOException, MojoFailureException
     {
         Set<String> moduleClasses = new HashSet<String>();
diff --git a/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java b/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
index 01e5b66..9b20876 100644
--- a/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/RunNetBeansMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -44,7 +44,7 @@
  * @author Milos Kleint
  *
  */
-@Mojo(name="run-ide", aggregator=true, requiresDependencyResolution= ResolutionScope.RUNTIME )
+@Mojo( name = "run-ide", aggregator = true, requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class RunNetBeansMojo
         extends AbstractMojo
 {
@@ -53,23 +53,23 @@
      * 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")
+    @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.
      */
-    @Parameter(required=true, property="netbeans.installation")
+    @Parameter( required = true, property = "netbeans.installation" )
     protected File netbeansInstallation;
     /**
      * NetBeans user directory for the executed instance.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}/userdir", property="netbeans.userdir")
+    @Parameter( required = true, defaultValue = "${project.build.directory}/userdir", property = "netbeans.userdir" )
     protected File netbeansUserdir;
     /**
      * additional command line arguments. 
      */
-    @Parameter(property="netbeans.run.params")
+    @Parameter( property = "netbeans.run.params" )
     protected String additionalArguments;
     
     /**
@@ -79,7 +79,7 @@
      * parameter).
      * @since 3.11.1
      */
-    @Parameter(property="netbeans.run.params.debug")
+    @Parameter( property = "netbeans.run.params.debug" )
     protected String debugAdditionalArguments;    
 
     /**
diff --git a/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java b/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
index c17688d..87cd5ba 100644
--- a/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
+++ b/src/main/java/org/apache/netbeans/nbm/RunPlatformAppMojo.java
@@ -1,3 +1,5 @@
+package org.apache.netbeans.nbm;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +19,6 @@
  * under the License.
  */
 
-package org.apache.netbeans.nbm;
-
 import java.io.File;
 import java.util.List;
 import java.util.ArrayList;
@@ -40,7 +40,7 @@
  * @author Milos Kleint
  *
  */
-@Mojo(name="run-platform", requiresDependencyResolution= ResolutionScope.RUNTIME )
+@Mojo( name = "run-platform", requiresDependencyResolution = ResolutionScope.RUNTIME )
 public class RunPlatformAppMojo
         extends AbstractMojo
 {
@@ -48,24 +48,24 @@
     /**
      * The branding token for the application based on NetBeans platform.
      */
-    @Parameter(required=true, property="netbeans.branding.token")
+    @Parameter( required = true, property = "netbeans.branding.token" )
     protected String brandingToken;
     /**
      * output directory where the the NetBeans application is created.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}")
+    @Parameter( required = true, defaultValue = "${project.build.directory}" )
     private File outputDirectory;
 
     /**
      * NetBeans user directory for the executed instance.
      */
-    @Parameter(required=true, defaultValue="${project.build.directory}/userdir", property="netbeans.userdir")
+    @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.
      */
-    @Parameter(property="netbeans.run.params")
+    @Parameter( property = "netbeans.run.params" )
     protected String additionalArguments;
     
     /**
@@ -75,14 +75,14 @@
      * parameter).
      * @since 3.11
      */
-    @Parameter(property="netbeans.run.params.debug")
+    @Parameter( property = "netbeans.run.params.debug" )
     protected String debugAdditionalArguments;
     
     /**
      * The Maven Project.
      *
      */
-    @Parameter(required=true, readonly=true, property="project")
+    @Parameter( required = true, readonly = true, property = "project" )
     private MavenProject project;
 
     /**
@@ -95,7 +95,7 @@
     {
         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();
@@ -130,8 +130,8 @@
                     [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() )