Author: hboutemy Date: Fri Nov 28 21:54:06 2014 New Revision: 1642369 URL: http://svn.apache.org/r1642369 Log: updated parent pom and fixed errors reported by Checkstyle
Modified: maven/plugins/trunk/maven-pdf-plugin/pom.xml maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Modified: maven/plugins/trunk/maven-pdf-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/pom.xml?rev=1642369&r1=1642368&r2=1642369&view=diff ============================================================================== --- maven/plugins/trunk/maven-pdf-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-pdf-plugin/pom.xml Fri Nov 28 21:54:06 2014 @@ -25,7 +25,7 @@ under the License. <parent> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugins</artifactId> - <version>25</version> + <version>27</version> <relativePath>../maven-plugins/pom.xml</relativePath> </parent> @@ -74,7 +74,6 @@ under the License. <properties> <doxiaVersion>1.4</doxiaVersion> <mavenVersion>2.2.1</mavenVersion> - <mavenPluginVersion>3.2</mavenPluginVersion> </properties> <dependencyManagement> @@ -143,7 +142,6 @@ under the License. <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> - <version>${mavenPluginVersion}</version> <scope>provided</scope> </dependency> <dependency> @@ -278,14 +276,6 @@ under the License. <artifactId>maven-pdf-plugin</artifactId> <version>1.1</version> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>${mavenPluginVersion}</version> - <configuration> - <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> - </configuration> - </plugin> </plugins> </pluginManagement> @@ -309,17 +299,6 @@ under the License. </executions> </plugin> <!-- END SNIPPET: configuration --> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - <executions> - <execution> - <id>generate-descriptor</id> - <goals> - <goal>descriptor</goal> - </goals> - </execution> - </executions> - </plugin> <!-- Backward compatibility with Maven 2.0.x, see MNG-3402 --> <plugin> <artifactId>maven-shade-plugin</artifactId> @@ -398,15 +377,6 @@ under the License. <plugin> <artifactId>maven-invoker-plugin</artifactId> <configuration> - <debug>true</debug> - <projectsDirectory>src/it</projectsDirectory> - <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> - <pomIncludes> - <pomInclude>*/pom.xml</pomInclude> - </pomIncludes> - <postBuildHookScript>verify</postBuildHookScript> - <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> - <settingsFile>src/it/settings.xml</settingsFile> <goals> <goal>clean</goal> <goal>${project.groupId}:${project.artifactId}:${project.version}:pdf</goal> Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java?rev=1642369&r1=1642368&r2=1642369&view=diff ============================================================================== --- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java (original) +++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java Fri Nov 28 21:54:06 2014 @@ -19,7 +19,6 @@ package org.apache.maven.plugins.pdf; * under the License. */ - import java.io.IOException; import java.util.ArrayList; import java.util.Date; @@ -223,28 +222,34 @@ public class DocumentModelBuilder final List<DocumentAuthor> ret = new ArrayList<DocumentAuthor>( 4 ); - for (Object o : project.getDevelopers()) { + for ( Object o : project.getDevelopers() ) + { final Developer developer = (Developer) o; final DocumentAuthor author = new DocumentAuthor(); - author.setName(developer.getName()); - author.setEmail(developer.getEmail()); - author.setCompanyName(developer.getOrganization()); + author.setName( developer.getName() ); + author.setEmail( developer.getEmail() ); + author.setCompanyName( developer.getOrganization() ); StringBuilder roles = null; - for (final String role : developer.getRoles()) { - if (roles == null) { - roles = new StringBuilder(32); - } else { - roles.append(',').append(' '); + for ( final String role : developer.getRoles() ) + { + if ( roles == null ) + { + roles = new StringBuilder( 32 ); } - roles.append(role); + else + { + roles.append( ',' ).append( ' ' ); + } + roles.append( role ); } - if (roles != null) { - author.setPosition(roles.toString()); + if ( roles != null ) + { + author.setPosition( roles.toString() ); } - ret.add(author); + ret.add( author ); } return ret; Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=1642369&r1=1642368&r2=1642369&view=diff ============================================================================== --- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original) +++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Fri Nov 28 21:54:06 2014 @@ -487,7 +487,7 @@ public class PdfMojo for ( final Locale locale : getAvailableLocales() ) { - File generatedPdfSource = new File( getLocaleDirectory( workingDirectory, locale), outputName ); + File generatedPdfSource = new File( getLocaleDirectory( workingDirectory, locale ), outputName ); if ( !generatedPdfSource.exists() ) { @@ -495,7 +495,7 @@ public class PdfMojo continue; } - File generatedPdfDest = new File( getLocaleDirectory( outputDirectory, locale), outputName ); + File generatedPdfDest = new File( getLocaleDirectory( outputDirectory, locale ), outputName ); FileUtils.copyFile( generatedPdfSource, generatedPdfDest ); generatedPdfSource.delete(); @@ -532,7 +532,7 @@ public class PdfMojo context.put( "StringUtils", new StringUtils() ); context.put( "i18n", i18n ); context.put( "generateTOC", generateTOC ); - context.put( "validate", validate); + context.put( "validate", validate ); // Put any of the properties in directly into the Velocity context for ( Map.Entry<Object, Object> entry : project.getProperties().entrySet() ) @@ -1021,13 +1021,16 @@ public class PdfMojo } List mojoDescriptors = pluginDescriptor.getMojos(); - for (Object mojoDescriptor1 : mojoDescriptors) { + for ( Object mojoDescriptor1 : mojoDescriptors ) + { final MojoDescriptor mojoDescriptor = (MojoDescriptor) mojoDescriptor1; - if (goals.isEmpty() || (!goals.isEmpty() && goals.contains(mojoDescriptor.getGoal()))) { - MavenReport report = getMavenReport(mojoDescriptor); + if ( goals.isEmpty() || ( !goals.isEmpty() && goals.contains( mojoDescriptor.getGoal() ) ) ) + { + MavenReport report = getMavenReport( mojoDescriptor ); - generateMavenReport(report, mojoDescriptor.getPluginDescriptor().getPluginArtifact(), locale); + generateMavenReport( report, mojoDescriptor.getPluginDescriptor().getPluginArtifact(), + locale ); } } } @@ -1212,7 +1215,8 @@ public class PdfMojo File generatedReport = new File( outDir, report.getOutputName() + ".xml" ); String excludes = getDefaultExcludesWithLocales( getAvailableLocales(), getDefaultLocale() ); - List<String> files = FileUtils.getFileNames( siteDirectory, "*/" + report.getOutputName() + ".*", excludes, false ); + List<String> files = + FileUtils.getFileNames( siteDirectory, "*/" + report.getOutputName() + ".*", excludes, false ); if ( !locale.getLanguage().equals( defaultLocale.getLanguage() ) ) { files = @@ -1346,7 +1350,8 @@ public class PdfMojo if ( generatedSiteDirectory.exists() ) { String excludes = getDefaultExcludesWithLocales( getAvailableLocales(), getDefaultLocale() ); - List<String> generatedDirs = FileUtils.getDirectoryNames( generatedSiteDirectory, "*", excludes, true ); + List<String> generatedDirs = FileUtils.getDirectoryNames( generatedSiteDirectory, "*", excludes, + true ); if ( !locale.getLanguage().equals( getDefaultLocale().getLanguage() ) ) { generatedDirs = @@ -1487,18 +1492,21 @@ public class PdfMojo if ( pluginProject.getMailingLists() != null && !pluginProject.getMailingLists().isEmpty() ) { boolean appended = false; - for (Object o : pluginProject.getMailingLists()) { + for ( Object o : pluginProject.getMailingLists() ) + { MailingList mailingList = (MailingList) o; - if (StringUtils.isNotEmpty(mailingList.getName()) - && StringUtils.isNotEmpty(mailingList.getPost())) { - if (!appended) { - sb.append(" Mailing Lists:").append(EOL); + if ( StringUtils.isNotEmpty( mailingList.getName() ) + && StringUtils.isNotEmpty( mailingList.getPost() ) ) + { + if ( !appended ) + { + sb.append( " Mailing Lists:" ).append( EOL ); appended = true; } - sb.append(" ").append(mailingList.getName()); - sb.append(": ").append(mailingList.getPost()); - sb.append(EOL); + sb.append( " " ).append( mailingList.getName() ); + sb.append( ": " ).append( mailingList.getPost() ); + sb.append( EOL ); } } } @@ -1626,7 +1634,8 @@ public class PdfMojo // if this ever changes, we will have to revisit this code. final Properties properties = new Properties(); final InputStream in = - MavenProject.class.getClassLoader().getResourceAsStream( "META-INF/maven/org.apache.maven/maven-core/pom.properties" ); + MavenProject.class.getClassLoader().getResourceAsStream( "META-INF/maven/org.apache.maven/maven-core/" + + "pom.properties" ); try { properties.load( in );