The following document contains the results of PMD's CPD 4.3.
File | Line |
---|---|
org/apache/maven/plugin/dependency/ManualPurgeLocalRepositoryMojo.java | 84 |
org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java | 361 |
for ( String gavPattern : includes ) { if ( StringUtils.isEmpty( gavPattern ) ) { getLog().debug( "Skipping empty gav pattern: " + gavPattern ); continue; } String relativePath = gavToPath( gavPattern ); if ( StringUtils.isEmpty( relativePath ) ) { continue; } File purgeDir = new File( localRepository.getBasedir(), relativePath ); if ( purgeDir.exists() ) { getLog().debug( "Deleting directory: " + purgeDir ); try { FileUtils.deleteDirectory( purgeDir ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to purge directory: " + purgeDir ); } } } } /** * Convert a groupId:artifactId:version to a file system path * * @param gav, the groupId:artifactId:version string * @return */ private String gavToPath( String gav ) { if ( StringUtils.isEmpty( gav ) ) { return null; } String[] pathComponents = gav.split( ":" ); StringBuffer path = new StringBuffer( pathComponents[0].replace( '.', '/' ) ); for ( int i=1; i<pathComponents.length; ++i ) { path.append( "/" + pathComponents[i] ); } return path.toString(); } /** * Convert comma separated list of includes to List object * * @param include * @return the includes list */ private List<String> parseIncludes( String include ) |