From ca2b26ac5dd0483e8932abae7e1e65e6abcaa396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Tue, 19 Aug 2014 00:17:28 +0200 Subject: [PATCH] fix a lot of checkstyle violations for future m-checkstyle-p 2.13, as proof of concept for misc violations suppressions strategies --- .../internal/DefaultModelResolver.java | 25 +++++++---- .../repository/internal/package-info.java | 4 +- .../AbstractArtifactResolutionException.java | 3 ++ .../resolver/ArtifactNotFoundException.java | 5 ++- .../resolver/ArtifactResolutionException.java | 1 + .../versioning/ComparableVersion.java | 5 ++- .../versioning/DefaultArtifactVersion.java | 2 +- .../java/org/apache/maven/DefaultMaven.java | 44 ++++++++++--------- .../org/apache/maven/RepositoryUtils.java | 16 +++---- .../java/org/apache/maven/SessionModule.java | 2 +- .../repository/MavenArtifactRepository.java | 4 +- .../resolver/ArtifactResolutionResult.java | 8 ++-- ...DefaultMavenExecutionRequestPopulator.java | 5 +-- .../internal/DefaultMavenPluginManager.java | 5 ++- .../DefaultDependencyResolutionResult.java | 2 +- .../maven/project/DefaultProjectBuilder.java | 2 +- .../apache/maven/project/MavenProject.java | 5 ++- .../maven/project/ProjectModelResolver.java | 42 +++++++++++------- .../project/artifact/ProjectArtifact.java | 2 +- .../properties/internal/SystemProperties.java | 4 +- .../java/org/apache/maven/cli/CLIManager.java | 2 +- .../apache/maven/cli/CLIReportingUtils.java | 19 +++++--- .../java/org/apache/maven/cli/MavenCli.java | 39 +++++++++------- .../maven/cli/event/ExecutionEventLogger.java | 6 ++- .../maven/cli/logging/Slf4jLoggerManager.java | 3 +- maven-model/pom.xml | 4 ++ .../maven/model/io/xpp3/package-info.java | 1 + .../apache/maven/model/merge/ModelMerger.java | 9 ++-- .../maven/model/merge/package-info.java | 1 + .../org/apache/maven/model/package-info.java | 1 + .../plugin/descriptor/PluginDescriptor.java | 2 +- .../building/DefaultSettingsBuilder.java | 11 ++--- .../apache/maven/settings/RuntimeInfo.java | 2 + 33 files changed, 169 insertions(+), 117 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java index 859ab5ada6..bb5bf3c084 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java @@ -104,7 +104,7 @@ class DefaultModelResolver this.resolver = original.resolver; this.versionRangeResolver = original.versionRangeResolver; this.remoteRepositoryManager = original.remoteRepositoryManager; - this.repositories = new ArrayList(original.repositories); + this.repositories = new ArrayList( original.repositories ); this.externalRepositories = original.externalRepositories; this.repositoryIds = new HashSet( original.repositoryIds ); } @@ -117,14 +117,18 @@ class DefaultModelResolver } @Override - public void addRepository(final Repository repository, boolean replace) throws InvalidRepositoryException { + public void addRepository( final Repository repository, boolean replace ) + throws InvalidRepositoryException + { if ( session.isIgnoreArtifactDescriptorRepositories() ) { return; } - if ( !repositoryIds.add( repository.getId() ) ) { - if ( !replace ) { + if ( !repositoryIds.add( repository.getId() ) ) + { + if ( !replace ) + { return; } @@ -138,13 +142,16 @@ class DefaultModelResolver remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true ); } - private static void removeMatchingRepository(Iterable repositories, final String id) { - Iterables.removeIf(repositories, new Predicate() { + private static void removeMatchingRepository( Iterable repositories, final String id ) + { + Iterables.removeIf( repositories, new Predicate() + { @Override - public boolean apply(RemoteRepository remoteRepository) { - return remoteRepository.getId().equals(id); + public boolean apply( RemoteRepository remoteRepository ) + { + return remoteRepository.getId().equals( id ); } - }); + } ); } @Override diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/package-info.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/package-info.java index 826a5c0fe9..5582cf75f4 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/package-info.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/package-info.java @@ -1,5 +1,7 @@ +// CHECKSTYLE_OFF: RegexpHeader /** - * Aether extensions for utilizing the Maven POM and Maven repository metadata. + * Aether extensions for utilizing the Maven POM and Maven repository + * metadata. */ package org.apache.maven.repository.internal; diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java index 393e02833b..75192d043d 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java @@ -54,6 +54,7 @@ public class AbstractArtifactResolutionException static final String LS = System.getProperty( "line.separator" ); + @SuppressWarnings( "checkstyle:parameternumber" ) protected AbstractArtifactResolutionException( String message, String groupId, String artifactId, @@ -66,6 +67,7 @@ public class AbstractArtifactResolutionException this( message, groupId, artifactId, version, type, classifier, remoteRepositories, path, null ); } + @SuppressWarnings( "checkstyle:parameternumber" ) protected AbstractArtifactResolutionException( String message, String groupId, String artifactId, @@ -248,6 +250,7 @@ public class AbstractArtifactResolutionException return sb.toString(); } + @SuppressWarnings( "checkstyle:parameternumber" ) protected static String constructMissingArtifactMessage( String message, String indentation, String groupId, diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java index 6cc3a5402b..76f7b584c5 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactNotFoundException.java @@ -33,7 +33,8 @@ public class ArtifactNotFoundException { private String downloadUrl; - protected ArtifactNotFoundException( String message, Artifact artifact, List remoteRepositories ) + protected ArtifactNotFoundException( String message, Artifact artifact, + List remoteRepositories ) { super( message, artifact, remoteRepositories ); } @@ -52,6 +53,7 @@ public class ArtifactNotFoundException cause ); } + @SuppressWarnings( "checkstyle:parameternumber" ) public ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, String downloadUrl, List path, Throwable cause ) @@ -63,6 +65,7 @@ public class ArtifactNotFoundException this.downloadUrl = downloadUrl; } + @SuppressWarnings( "checkstyle:parameternumber" ) private ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, String downloadUrl, List path ) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java index 5250261b10..074d812caa 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java @@ -30,6 +30,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; public class ArtifactResolutionException extends AbstractArtifactResolutionException { + @SuppressWarnings( "checkstyle:parameternumber" ) public ArtifactResolutionException( String message, String groupId, String artifactId, String version, String type, String classifier, List remoteRepositories, List path, Throwable t ) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java index e79b238561..508f79c091 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java @@ -149,6 +149,7 @@ public class ComparableVersion { private static final String[] QUALIFIERS = { "alpha", "beta", "milestone", "rc", "snapshot", "", "sp" }; + @SuppressWarnings( "checkstyle:constantname" ) private static final List _QUALIFIERS = Arrays.asList( QUALIFIERS ); private static final Properties ALIASES = new Properties(); @@ -183,6 +184,7 @@ public class ComparableVersion case 'm': value = "milestone"; break; + default: } } this.value = ALIASES.getProperty( value , value ); @@ -201,7 +203,8 @@ public class ComparableVersion /** * Returns a comparable value for a qualifier. * - * This method takes into account the ordering of known qualifiers then unknown qualifiers with lexical ordering. + * This method takes into account the ordering of known qualifiers then unknown qualifiers with lexical + * ordering. * * just returning an Integer with the index here is faster, but requires a lot of if/then/else to check for -1 * or QUALIFIERS.size and then resort to lexical ordering. Most comparisons are decided by the first character, diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java index 7a61128f89..99b2b85b81 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java @@ -214,7 +214,7 @@ public class DefaultArtifactVersion } return Integer.valueOf( s ); } - catch( NoSuchElementException e ) + catch ( NoSuchElementException e ) { throw new NumberFormatException( "Number is invalid" ); } diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java index af0defdb0f..ba629725cb 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -131,7 +131,7 @@ public class DefaultMaven private RepositorySystem repoSystem; @Requirement( optional = true, hint = "simple" ) - private LocalRepositoryManagerFactory simpleLocalRepositoryManagerFactory; + private LocalRepositoryManagerFactory simpleLocalRepoMgrFactory; @Requirement private SettingsDecrypter settingsDecrypter; @@ -188,21 +188,22 @@ public class DefaultMaven // // 6) Get reactor projects looking for general POM errors // - // 7) Create ProjectDependencyGraph using trimming which takes into account --projects and reactor mode. This ensures - // that the projects passed into the ReactorReader are only those specified. + // 7) Create ProjectDependencyGraph using trimming which takes into account --projects and reactor mode. + // This ensures that the projects passed into the ReactorReader are only those specified. // // 8) Create ReactorReader with the getProjectMap( projects ). NOTE that getProjectMap(projects) is the code that - // checks for duplicate projects definitions in the build. Ideally this type of duplicate checking should be part of - // getting the reactor projects in 6). The duplicate checking is conflated with getProjectMap(projects). + // checks for duplicate projects definitions in the build. Ideally this type of duplicate checking should be + // part of getting the reactor projects in 6). The duplicate checking is conflated with getProjectMap(projects). // // 9) Execute AbstractLifecycleParticipant.afterProjectsRead(session) // - // 10) Create ProjectDependencyGraph without trimming (as trimming was done in 7). A new topological sort is required after - // the execution of 9) as the AbstractLifecycleParticipants are free to mutate the MavenProject instances, which may change - // dependencies which can, in turn, affect the build order. - // + // 10) Create ProjectDependencyGraph without trimming (as trimming was done in 7). A new topological sort is + // required after the execution of 9) as the AbstractLifecycleParticipants are free to mutate the MavenProject + // instances, which may change dependencies which can, in turn, affect the build order. + // // 11) Execute LifecycleStarter.start() - // + // + @SuppressWarnings( "checkstyle:methodlength" ) private MavenExecutionResult doExecute( MavenExecutionRequest request ) { request.setStartTime( new Date() ); @@ -225,7 +226,7 @@ public class DefaultMaven try { - for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections. emptyList() ) ) + for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.emptyList() ) ) { listener.afterSessionStart( session ); } @@ -430,10 +431,11 @@ public class DefaultMaven if ( request.isUseLegacyLocalRepository() ) { - logger.warn( "Disabling enhanced local repository: using legacy is strongly discouraged to ensure build reproducibility." ); + logger.warn( "Disabling enhanced local repository: using legacy is strongly discouraged to ensure" + + " build reproducibility." ); try { - session.setLocalRepositoryManager( simpleLocalRepositoryManagerFactory.newInstance( session, localRepo ) ); + session.setLocalRepositoryManager( simpleLocalRepoMgrFactory.newInstance( session, localRepo ) ); } catch ( NoLocalRepositoryManagerException e ) { @@ -677,8 +679,8 @@ public class DefaultMaven for ( ModelProblem problem : result.getProblems() ) { - String location = ModelProblemUtils.formatLocation( problem, result.getProjectId() ); - logger.warn( problem.getMessage() + ( StringUtils.isNotEmpty( location ) ? " @ " + location : "" ) ); + String loc = ModelProblemUtils.formatLocation( problem, result.getProjectId() ); + logger.warn( problem.getMessage() + ( StringUtils.isNotEmpty( loc ) ? " @ " + loc : "" ) ); } problems = true; @@ -743,11 +745,11 @@ public class DefaultMaven { Map projectsMap = new HashMap(); - for ( MavenProject project : projects ) + for ( MavenProject p : projects ) { - String projectKey = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + String projectKey = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() ); - projectsMap.put( projectKey, project ); + projectsMap.put( projectKey, p ); } for ( MavenProject project : projects ) @@ -763,7 +765,8 @@ public class DefaultMaven if ( projectsMap.containsKey( pluginKey ) ) { logger.warn( project.getName() + " uses " + plugin.getKey() - + " as extensions, which is not possible within the same reactor build. This plugin was pulled from the local repository!" ); + + " as extensions, which is not possible within the same reactor build. " + + "This plugin was pulled from the local repository!" ); } } } @@ -795,7 +798,8 @@ public class DefaultMaven return logger; } - private ProjectDependencyGraph createProjectDependencyGraph( Collection projects, MavenExecutionRequest request, + private ProjectDependencyGraph createProjectDependencyGraph( Collection projects, + MavenExecutionRequest request, MavenExecutionResult result, boolean trimming ) { ProjectDependencyGraph projectDependencyGraph = null; diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java index 059c9e6b4f..9190c0c230 100644 --- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java +++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -25,17 +25,11 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; -import org.apache.maven.artifact.repository.MavenArtifactRepository; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout2; -import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; -import org.codehaus.plexus.util.StringUtils; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.artifact.ArtifactType; @@ -122,7 +116,7 @@ public class RepositoryUtils nodeTrail.addAll( trail ); nodeTrail.add( artifact.getId() ); - if ( filter == null || filter.accept( node, Collections. emptyList() ) ) + if ( filter == null || filter.accept( node, Collections.emptyList() ) ) { artifact.setDependencyTrail( nodeTrail ); artifacts.add( artifact ); @@ -282,10 +276,10 @@ public class RepositoryUtils DefaultArtifactHandler handler = new DefaultArtifactHandler( type ); handler.setExtension( artifact.getExtension() ); handler.setLanguage( artifact.getProperty( ArtifactProperties.LANGUAGE, null ) ); - handler.setAddedToClasspath( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.CONSTITUTES_BUILD_PATH, - "" ) ) ); - handler.setIncludesDependencies( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES, - "" ) ) ); + String addedToClasspath = artifact.getProperty( ArtifactProperties.CONSTITUTES_BUILD_PATH, "" ); + handler.setAddedToClasspath( Boolean.parseBoolean( addedToClasspath ) ); + String includesDependencies = artifact.getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES, "" ); + handler.setIncludesDependencies( Boolean.parseBoolean( includesDependencies ) ); return handler; } diff --git a/maven-core/src/main/java/org/apache/maven/SessionModule.java b/maven-core/src/main/java/org/apache/maven/SessionModule.java index c3438c6616..ee853ce6c1 100644 --- a/maven-core/src/main/java/org/apache/maven/SessionModule.java +++ b/maven-core/src/main/java/org/apache/maven/SessionModule.java @@ -34,6 +34,6 @@ public class SessionModule extends AbstractModule SessionScope scope = new SessionScope(); bindScope( SessionScoped.class, scope ); bind( SessionScope.class ).toInstance( scope ); - bind( MavenSession.class ).toProvider( SessionScope. seededKeyProvider() ).in( scope ); + bind( MavenSession.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope ); } } diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java b/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java index fa503a09da..8f4744388b 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java @@ -138,9 +138,9 @@ public class MavenArtifactRepository sb.append( " url: " ).append( getUrl() ).append( "\n" ); sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( "\n" ); - if( proxy != null) + if ( proxy != null ) { - sb.append(" proxy: " ).append( proxy.getHost() ).append(":").append( proxy.getPort() ).append( "\n" ); + sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" ); } if ( snapshots != null ) diff --git a/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java b/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java index 73a8a397a3..86bfdb607d 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java @@ -125,7 +125,7 @@ public class ArtifactResolutionResult public List getMissingArtifacts() { - return missingArtifacts == null ? Collections. emptyList() : missingArtifacts; + return missingArtifacts == null ? Collections.emptyList() : missingArtifacts; } public ArtifactResolutionResult addMissingArtifact( Artifact artifact ) @@ -160,7 +160,7 @@ public class ArtifactResolutionResult public List getExceptions() { - return exceptions == null ? Collections. emptyList() : exceptions; + return exceptions == null ? Collections.emptyList() : exceptions; } // ------------------------------------------------------------------------ @@ -197,7 +197,7 @@ public class ArtifactResolutionResult public List getVersionRangeViolations() { - return versionRangeViolations == null ? Collections. emptyList() : versionRangeViolations; + return versionRangeViolations == null ? Collections.emptyList() : versionRangeViolations; } // ------------------------------------------------------------------------ @@ -229,7 +229,7 @@ public class ArtifactResolutionResult public List getMetadataResolutionExceptions() { - return metadataResolutionExceptions == null ? Collections. emptyList() + return metadataResolutionExceptions == null ? Collections.emptyList() : metadataResolutionExceptions; } diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java index a7e93a8f54..90d79d1bb9 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java @@ -24,7 +24,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.bridge.MavenRepositorySystem; @@ -114,8 +113,8 @@ public class DefaultMavenExecutionRequestPopulator for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() ) { request.addProfile( SettingsUtils.convertFromSettingsProfile( rawProfile ) ); - - if(settings.getActiveProfiles().contains( rawProfile.getId() )) + + if ( settings.getActiveProfiles().contains( rawProfile.getId() ) ) { List remoteRepositories = rawProfile.getRepositories(); for( Repository remoteRepository : remoteRepositories ) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 90dd9ec88f..94b4e6fe39 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -136,7 +136,8 @@ public class DefaultMavenPluginManager private PluginDescriptorBuilder builder = new PluginDescriptorBuilder(); - public synchronized PluginDescriptor getPluginDescriptor( Plugin plugin, List repositories, RepositorySystemSession session ) + public synchronized PluginDescriptor getPluginDescriptor( Plugin plugin, List repositories, + RepositorySystemSession session ) throws PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException { PluginDescriptorCache.Key cacheKey = pluginDescriptorCache.createKey( plugin, repositories, session ); @@ -365,7 +366,7 @@ public class DefaultMavenPluginManager List exposedPluginArtifacts = new ArrayList( nlg.getNodes().size() ); RepositoryUtils.toArtifacts( exposedPluginArtifacts, Collections.singleton( root ), - Collections. emptyList(), null ); + Collections.emptyList(), null ); for ( Iterator it = exposedPluginArtifacts.iterator(); it.hasNext(); ) { Artifact artifact = it.next(); diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java index b69b69ed02..07c6a2f9f2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java @@ -98,7 +98,7 @@ class DefaultDependencyResolutionResult public List getResolutionErrors( Dependency dependency ) { List errors = resolutionErrors.get( dependency ); - return ( errors != null ) ? errors : Collections. emptyList(); + return ( errors != null ) ? errors : Collections.emptyList(); } public void setResolutionErrors( Dependency dependency, List errors ) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 8e1d51e75f..4d77049434 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -171,7 +171,7 @@ public class DefaultProjectBuilder modelProblems = result.getProblems(); - initProject( project, Collections. emptyMap(), result, + initProject( project, Collections.emptyMap(), result, new HashMap(), projectBuildingRequest ); } else if ( projectBuildingRequest.isResolveDependencies() ) diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java index 040d3a3dfb..9a65b7fe38 100644 --- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -846,7 +846,8 @@ public class MavenProject public ArtifactRepository getDistributionManagementArtifactRepository() { - return getArtifact().isSnapshot() && ( getSnapshotArtifactRepository() != null ) ? getSnapshotArtifactRepository() + return getArtifact().isSnapshot() && ( getSnapshotArtifactRepository() != null ) + ? getSnapshotArtifactRepository() : getReleaseArtifactRepository(); } @@ -1407,7 +1408,7 @@ public class MavenProject */ public void setResolvedArtifacts( Set artifacts ) { - this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections. emptySet(); + this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.emptySet(); this.artifacts = null; this.artifactMap = null; } diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java index c95dc4b713..43609cedb2 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java @@ -91,10 +91,10 @@ class ProjectModelResolver this.remoteRepositoryManager = remoteRepositoryManager; this.pomRepositories = new ArrayList(); List externalRepositories = new ArrayList(); - externalRepositories.addAll(repositories); - this.externalRepositories = Collections.unmodifiableList(externalRepositories); + externalRepositories.addAll( repositories ); + this.externalRepositories = Collections.unmodifiableList( externalRepositories ); this.repositories = new ArrayList(); - this.repositories.addAll(externalRepositories); + this.repositories.addAll( externalRepositories ); this.repositoryMerging = repositoryMerging; this.repositoryIds = new HashSet(); this.modelPool = modelPool; @@ -106,9 +106,9 @@ class ProjectModelResolver this.trace = original.trace; this.resolver = original.resolver; this.remoteRepositoryManager = original.remoteRepositoryManager; - this.pomRepositories = new ArrayList(original.pomRepositories); + this.pomRepositories = new ArrayList( original.pomRepositories ); this.externalRepositories = original.externalRepositories; - this.repositories = new ArrayList(original.repositories); + this.repositories = new ArrayList( original.repositories ); this.repositoryMerging = original.repositoryMerging; this.repositoryIds = new HashSet( original.repositoryIds ); this.modelPool = original.modelPool; @@ -121,15 +121,19 @@ class ProjectModelResolver } @Override - public void addRepository(final Repository repository, boolean replace) throws InvalidRepositoryException { - if ( !repositoryIds.add( repository.getId() ) ) { - if ( !replace ) { + public void addRepository( final Repository repository, boolean replace ) + throws InvalidRepositoryException + { + if ( !repositoryIds.add( repository.getId() ) ) + { + if ( !replace ) + { return; } - //Remove any previous repository with this Id - removeMatchingRepository(repositories, repository.getId()); - removeMatchingRepository(pomRepositories, repository.getId()); + // Remove any previous repository with this Id + removeMatchingRepository( repositories, repository.getId() ); + removeMatchingRepository( pomRepositories, repository.getId() ); } List newRepositories = @@ -137,7 +141,8 @@ class ProjectModelResolver if ( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT.equals( repositoryMerging ) ) { - repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, true ); + repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, + true ); } else { @@ -148,13 +153,16 @@ class ProjectModelResolver } } - private static void removeMatchingRepository(Iterable repositories, final String id) { - Iterables.removeIf(repositories, new Predicate() { + private static void removeMatchingRepository( Iterable repositories, final String id ) + { + Iterables.removeIf( repositories, new Predicate() + { @Override - public boolean apply(RemoteRepository remoteRepository) { - return remoteRepository.getId().equals(id); + public boolean apply( RemoteRepository remoteRepository ) + { + return remoteRepository.getId().equals( id ); } - }); + } ); } public ModelResolver newCopy() diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java index e4b44e79a9..1d4a2a313b 100644 --- a/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java +++ b/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java @@ -56,7 +56,7 @@ public class ProjectArtifact public List getManagedDependencies() { DependencyManagement depMngt = project.getDependencyManagement(); - return ( depMngt != null ) ? depMngt.getDependencies() : Collections. emptyList(); + return ( depMngt != null ) ? depMngt.getDependencies() : Collections.emptyList(); } static class PomArtifactHandler diff --git a/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java b/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java index 9cb07c4d12..81489a2eda 100644 --- a/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java +++ b/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java @@ -1,7 +1,5 @@ package org.apache.maven.properties.internal; -import java.util.Properties; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -21,6 +19,8 @@ import java.util.Properties; * under the License. */ +import java.util.Properties; + /** * @since 3.2.3 */ diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index aa22d235a4..04e31b30ea 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -103,7 +103,7 @@ public class CLIManager protected Options options; - @SuppressWarnings( "static-access" ) + @SuppressWarnings( { "static-access", "checkstyle:linelength" } ) public CLIManager() { options = new Options(); diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java index 6176f243d0..07863b723c 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java @@ -38,30 +38,31 @@ import org.slf4j.Logger; */ public final class CLIReportingUtils { - + // CHECKSTYLE_OFF: MagicNumber public static final long MB = 1024 * 1024; private static final long ONE_SECOND = 1000L; private static final long ONE_MINUTE = 60 * ONE_SECOND; private static final long ONE_HOUR = 60 * ONE_MINUTE; private static final long ONE_DAY = 24 * ONE_HOUR; + // CHECKSTYLE_ON: MagicNumber public static final String BUILD_VERSION_PROPERTY = "version"; public static String showVersion() { - final String LS = System.getProperty( "line.separator" ); + final String ls = System.getProperty( "line.separator" ); Properties properties = getBuildProperties(); StringBuilder version = new StringBuilder(); - version.append( createMavenVersionString( properties ) ).append( LS ); + version.append( createMavenVersionString( properties ) ).append( ls ); version.append( reduce( properties.getProperty( "distributionShortName" ) + " home: " - + System.getProperty( "maven.home", "" ) ) ).append( LS ); + + System.getProperty( "maven.home", "" ) ) ).append( ls ); version.append( "Java version: " ).append( System.getProperty( "java.version", "" ) ).append( ", vendor: " ).append( - System.getProperty( "java.vendor", "" ) ).append( LS ); - version.append( "Java home: " ).append( System.getProperty( "java.home", "" ) ).append( LS ); + System.getProperty( "java.vendor", "" ) ).append( ls ); + version.append( "Java home: " ).append( System.getProperty( "java.home", "" ) ).append( ls ); version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append( - System.getProperty( "file.encoding", "" ) ).append( LS ); + System.getProperty( "file.encoding", "" ) ).append( ls ); version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append( "\", arch: \"" ).append( Os.OS_ARCH ).append( "\", family: \"" ).append( Os.OS_FAMILY ).append( "\"" ); return version.toString(); @@ -160,8 +161,10 @@ public final class CLIReportingUtils offset += tz.getDSTSavings(); } + // CHECKSTYLE_OFF: MagicNumber long m = Math.abs( ( offset / ONE_MINUTE ) % 60 ); long h = Math.abs( ( offset / ONE_HOUR ) % 24 ); + // CHECKSTYLE_ON: MagicNumber int offsetDir = (int) Math.signum( (float) offset ); char offsetSign = offsetDir >= 0 ? '+' : '-'; @@ -170,11 +173,13 @@ public final class CLIReportingUtils public static String formatDuration( long duration ) { + // CHECKSTYLE_OFF: MagicNumber long ms = duration % 1000; long s = ( duration / ONE_SECOND ) % 60; long m = ( duration / ONE_MINUTE ) % 60; long h = ( duration / ONE_HOUR ) % 24; long d = duration / ONE_DAY; + // CHECKSTYLE_ON: MagicNumber String format; if ( d > 0 ) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 9e64dd1aa3..56884b3890 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -100,8 +100,10 @@ public class MavenCli public static final String THREADS_DEPRECATED = "maven.threads.experimental"; + @SuppressWarnings( "checkstyle:constantname" ) public static final String userHome = System.getProperty( "user.home" ); + @SuppressWarnings( "checkstyle:constantname" ) public static final File userMavenConfigurationHome = new File( userHome, ".m2" ); public static final File DEFAULT_USER_SETTINGS_FILE = new File( userMavenConfigurationHome, "settings.xml" ); @@ -266,8 +268,8 @@ public class MavenCli throws Exception { // - // Parsing errors can happen during the processing of the arguments and we prefer not having to check if the logger is null - // and construct this so we can use an SLF4J logger everywhere. + // Parsing errors can happen during the processing of the arguments and we prefer not having to check if + // the logger is null and construct this so we can use an SLF4J logger everywhere. // slf4jLogger = new Slf4jStdoutLogger(); @@ -498,10 +500,9 @@ public class MavenCli if ( passwd == null ) { - Console cons; - char[] password; - if ( ( cons = System.console() ) != null - && ( password = cons.readPassword( "Master password: " ) ) != null ) + Console cons = System.console(); + char[] password = ( cons == null ) ? null : cons.readPassword( "Master password: " ); + if ( password != null ) { // Cipher uses Strings passwd = String.copyValueOf( password ); @@ -513,7 +514,8 @@ public class MavenCli DefaultPlexusCipher cipher = new DefaultPlexusCipher(); - System.out.println( cipher.encryptAndDecorate( passwd, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) ); + System.out.println( cipher.encryptAndDecorate( passwd, + DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) ); throw new ExitException( 0 ); } @@ -523,10 +525,9 @@ public class MavenCli if ( passwd == null ) { - Console cons; - char[] password; - if ( ( cons = System.console() ) != null - && ( password = cons.readPassword( "Password: " ) ) != null ) + Console cons = System.console(); + char[] password = ( cons == null ) ? null : cons.readPassword( "Password: " ); + if ( password != null ) { // Cipher uses Strings passwd = String.copyValueOf( password ); @@ -569,7 +570,8 @@ public class MavenCli private void repository( CliRequest cliRequest ) throws Exception { - if ( cliRequest.commandLine.hasOption( CLIManager.LEGACY_LOCAL_REPOSITORY ) || Boolean.getBoolean( "maven.legacyLocalRepo" ) ) + if ( cliRequest.commandLine.hasOption( CLIManager.LEGACY_LOCAL_REPOSITORY ) + || Boolean.getBoolean( "maven.legacyLocalRepo" ) ) { cliRequest.request.setUseLegacyLocalRepository( true ); } @@ -687,7 +689,8 @@ public class MavenCli { String line = indent + lines[i].trim(); - if ( i == lines.length - 1 && ( showErrors || ( summary.getException() instanceof InternalErrorException ) ) ) + if ( ( i == lines.length - 1 ) + && ( showErrors || ( summary.getException() instanceof InternalErrorException ) ) ) { slf4jLogger.error( line, summary.getException() ); } @@ -705,6 +708,7 @@ public class MavenCli } } + @SuppressWarnings( "checkstyle:methodlength" ) private void settings( CliRequest cliRequest ) throws Exception { @@ -757,7 +761,8 @@ public class MavenCli eventSpyDispatcher.onEvent( settingsRequest ); slf4jLogger.debug( "Reading global settings from " - + getSettingsLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) ); + + getSettingsLocation( settingsRequest.getGlobalSettingsSource(), + settingsRequest.getGlobalSettingsFile() ) ); slf4jLogger.debug( "Reading user settings from " + getSettingsLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) ); @@ -1074,9 +1079,9 @@ public class MavenCli // Builder, concurrency and parallelism // // We preserve the existing methods for builder selection which is to look for various inputs in the threading - // configuration. We don't have an easy way to allow a pluggable builder to provide its own configuration parameters - // but this is sufficient for now. Ultimately we want components like Builders to provide a way to extend the command - // line to accept its own configuration parameters. + // configuration. We don't have an easy way to allow a pluggable builder to provide its own configuration + // parameters but this is sufficient for now. Ultimately we want components like Builders to provide a way to + // extend the command line to accept its own configuration parameters. // final String threadConfiguration = commandLine.hasOption( CLIManager.THREADS ) ? commandLine.getOptionValue( CLIManager.THREADS ) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java index c51ee571ab..ad3ad3a42d 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java @@ -216,9 +216,9 @@ public class ExecutionEventLogger Runtime r = Runtime.getRuntime(); - long MB = 1024 * 1024; + long mb = 1024 * 1024; - logger.info( "Final Memory: " + ( r.totalMemory() - r.freeMemory() ) / MB + "M/" + r.totalMemory() / MB + "M" ); + logger.info( "Final Memory: " + ( r.totalMemory() - r.freeMemory() ) / mb + "M/" + r.totalMemory() / mb + "M" ); } @Override @@ -303,10 +303,12 @@ public class ExecutionEventLogger } } + // CHECKSTYLE_OFF: LineLength /** *
<<< mojo-artifactId:version:goal (mojo-executionId) < :forked-goal @ project-artifactId <<<
*
<<< mojo-artifactId:version:goal (mojo-executionId) < [lifecycle]phase @ project-artifactId <<<
*/ + // CHECKSTYLE_ON: LineLength @Override public void forkSucceeded( ExecutionEvent event ) { diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java index f30ea8f68e..529f19eb0f 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/Slf4jLoggerManager.java @@ -25,7 +25,8 @@ import org.slf4j.ILoggerFactory; import org.slf4j.LoggerFactory; /** - * Use an SLF4J {@link org.slf4j.ILoggerFactory} as a backing for a Plexus {@link org.codehaus.plexus.logging.LoggerManager}, + * Use an SLF4J {@link org.slf4j.ILoggerFactory} as a backing for a Plexus + * {@link org.codehaus.plexus.logging.LoggerManager}, * ignoring Plexus logger API parts that are not classical and probably not really used. * * @author Jason van Zyl diff --git a/maven-model/pom.xml b/maven-model/pom.xml index 79c6dee4a2..81fe926201 100644 --- a/maven-model/pom.xml +++ b/maven-model/pom.xml @@ -39,6 +39,10 @@ under the License. HEAD + + FileLength + + org.codehaus.plexus diff --git a/maven-model/src/main/java/org/apache/maven/model/io/xpp3/package-info.java b/maven-model/src/main/java/org/apache/maven/model/io/xpp3/package-info.java index 4180b55bfe..c52dd8e644 100644 --- a/maven-model/src/main/java/org/apache/maven/model/io/xpp3/package-info.java +++ b/maven-model/src/main/java/org/apache/maven/model/io/xpp3/package-info.java @@ -1,3 +1,4 @@ +// CHECKSTYLE_OFF: RegexpHeader|LineLength /** * XML reader and writer classes for Maven POM, generated from maven.mdo model. * These classes use diff --git a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java index 88e866b0b2..b671d9816c 100644 --- a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java +++ b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java @@ -76,14 +76,17 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; * Map context ) for each model class *
  • mergeClassname_FieldName( Classname target, Classname source, boolean * sourceDominant, Map context ) for each field of each model class
  • - *
  • Object getClassnameKey( Classname classname ) for each class that is used in a list
  • + *
  • Object getClassnameKey( Classname classname ) + * for each class that is used in a list
  • * * Code is written like it could be generated, with default behaviour to be overridden when necessary. - * This is particularly the case for Object getClassnameKey( Classname classname ) method, - * which by default return the object itself and is expected to be overridden to calculate better suited key value. + * This is particularly the case for Object getClassnameKey( Classname classname ) + * method, which by default return the object itself and is expected to be overridden to calculate better suited key + * value. * * @author Benjamin Bentmann */ +@SuppressWarnings( { "checkstyle:methodname" } ) public class ModelMerger { diff --git a/maven-model/src/main/java/org/apache/maven/model/merge/package-info.java b/maven-model/src/main/java/org/apache/maven/model/merge/package-info.java index 156ae704ea..eaa2d174e2 100644 --- a/maven-model/src/main/java/org/apache/maven/model/merge/package-info.java +++ b/maven-model/src/main/java/org/apache/maven/model/merge/package-info.java @@ -1,3 +1,4 @@ +// CHECKSTYLE_OFF: RegexpHeader /** * POM merger. */ diff --git a/maven-model/src/main/java/org/apache/maven/model/package-info.java b/maven-model/src/main/java/org/apache/maven/model/package-info.java index 0a546d176a..88d3fa0701 100644 --- a/maven-model/src/main/java/org/apache/maven/model/package-info.java +++ b/maven-model/src/main/java/org/apache/maven/model/package-info.java @@ -1,3 +1,4 @@ +// CHECKSTYLE_OFF: RegexpHeader /** * Maven POM (Project Object Model) classes, generated from maven.mdo model. * The root class is {@link org.apache.maven.model.Model}. diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java index 460c401ae8..b15f7e0c54 100644 --- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java +++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java @@ -317,7 +317,7 @@ public class PluginDescriptor public Set getIntroducedDependencyArtifacts() { return ( introducedDependencyArtifacts != null ) ? introducedDependencyArtifacts - : Collections. emptySet(); + : Collections.emptySet(); } public void setName( String name ) diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java index 9561e9bd1d..74709aea98 100644 --- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java +++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java @@ -180,14 +180,14 @@ public class DefaultSettingsBuilder } catch ( SettingsParseException e ) { - problems.add( SettingsProblem.Severity.FATAL, "Non-parseable settings " + settingsSource.getLocation() + ": " - + e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + problems.add( SettingsProblem.Severity.FATAL, "Non-parseable settings " + settingsSource.getLocation() + + ": " + e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); return new Settings(); } catch ( IOException e ) { - problems.add( SettingsProblem.Severity.FATAL, "Non-readable settings " + settingsSource.getLocation() + ": " - + e.getMessage(), -1, -1, e ); + problems.add( SettingsProblem.Severity.FATAL, "Non-readable settings " + settingsSource.getLocation() + + ": " + e.getMessage(), -1, -1, e ); return new Settings(); } @@ -196,7 +196,8 @@ public class DefaultSettingsBuilder return settings; } - private Settings interpolate( Settings settings, SettingsBuildingRequest request, SettingsProblemCollector problems ) + private Settings interpolate( Settings settings, SettingsBuildingRequest request, + SettingsProblemCollector problems ) { StringWriter writer = new StringWriter( 1024 * 4 ); diff --git a/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java b/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java index 6de1330c45..9020037f84 100644 --- a/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java +++ b/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java @@ -28,8 +28,10 @@ import java.io.File; @Deprecated public class RuntimeInfo { + @SuppressWarnings( "checkstyle:constantname" ) public static final String userHome = System.getProperty( "user.home" ); + @SuppressWarnings( "checkstyle:constantname" ) public static final File userMavenConfigurationHome = new File( userHome, ".m2" ); public static final File DEFAULT_USER_SETTINGS_FILE = new File( userMavenConfigurationHome, "settings.xml" );