You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jd...@apache.org on 2005/04/26 03:32:09 UTC
svn commit: r164705 [2/2] - in
/maven/components/trunk/sandbox/repoclean/src/main: bash/
java/org/apache/maven/tools/repoclean/
java/org/apache/maven/tools/repoclean/artifact/handler/
java/org/apache/maven/tools/repoclean/artifact/layout/
java/org/apache/maven/tools/repoclean/artifact/metadata/
java/org/apache/maven/tools/repoclean/digest/
java/org/apache/maven/tools/repoclean/discover/
java/org/apache/maven/tools/repoclean/index/
java/org/apache/maven/tools/repoclean/report/
java/org/apache/maven/tools/repoclean/rewrite/
java/org/apache/maven/tools/repoclean/transaction/
java/org/apache/maven/tools/repoclean/translate/ resources/META-INF/plexus/
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java?rev=164705&r1=164704&r2=164705&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RewriteTransaction.java Mon Apr 25 18:32:07 2005
@@ -48,8 +48,8 @@
File file = (File) it.next();
if ( file.exists() && !file.delete() )
{
- throw new RollbackException( "[rollback] Cannot delete file: " + file
- + "\nPart of transaction for artifact: {" + artifact.getId() + "}." );
+ throw new RollbackException( "[rollback] Cannot delete file: " + file +
+ "\nPart of transaction for artifact: {" + artifact.getId() + "}." );
}
}
}
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java?rev=164705&r1=164704&r2=164705&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/transaction/RollbackException.java Mon Apr 25 18:32:07 2005
@@ -16,8 +16,7 @@
* limitations under the License.
*/
-public class RollbackException
- extends Exception
+public class RollbackException extends Exception
{
public RollbackException( String message, Throwable cause )
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java?rev=164705&r1=164704&r2=164705&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomTranslationException.java Mon Apr 25 18:32:07 2005
@@ -20,8 +20,7 @@
/**
* @author jdcasey
*/
-public class PomTranslationException
- extends Exception
+public class PomTranslationException extends Exception
{
private final String groupId;
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java?rev=164705&r1=164704&r2=164705&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java Mon Apr 25 18:32:07 2005
@@ -35,12 +35,12 @@
/*
* ==================================================================== Copyright 2001-2004 The
* Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
@@ -50,12 +50,11 @@
/**
* @author jdcasey
*/
-public class PomV3ToV4Translator
- extends AbstractLogEnabled
+public class PomV3ToV4Translator extends AbstractLogEnabled
{
public static final String ROLE = PomV3ToV4Translator.class.getName();
-
+
private transient List discoveredPlugins = new ArrayList();
public Model translate( org.apache.maven.model.v3_0_0.Model v3Model, Reporter reporter )
@@ -97,7 +96,7 @@
model.setArtifactId( artifactId );
// moved this above the translation of the build, to allow
- // additional plugins to be defined in v3 poms via
+ // additional plugins to be defined in v3 poms via
// <dependency><type>plugin</type></dependency>
model.setDependencies( translateDependencies( v3Model.getDependencies() ) );
@@ -141,7 +140,7 @@
private String format( String source )
{
- return (source == null)?(null):(source.replace('+', '-'));
+ return ( source == null ) ? ( null ) : ( source.replace( '+', '-' ) );
}
private CiManagement translateCiManagementInfo( org.apache.maven.model.v3_0_0.Build v3Build )
@@ -177,8 +176,8 @@
if ( StringUtils.isNotEmpty( v3Model.getGumpRepositoryId() ) )
{
- reporter.warn( "Ignoring gump repository id: \'" + v3Model.getGumpRepositoryId()
- + "\'. This is not supported in v4 POMs." );
+ reporter.warn( "Ignoring gump repository id: \'" + v3Model.getGumpRepositoryId() +
+ "\'. This is not supported in v4 POMs." );
}
if ( notEmpty( v3Model.getVersions() ) )
@@ -252,8 +251,8 @@
String reportPluginName = null;
if ( !matcher.matches() )
{
- reporter.warn( "Non-standard report name: \'" + reportName
- + "\'. Using entire name for plugin artifactId." );
+ reporter.warn( "Non-standard report name: \'" + reportName +
+ "\'. Using entire name for plugin artifactId." );
reportPluginName = reportName;
}
@@ -273,14 +272,10 @@
StringBuffer info = new StringBuffer();
info.append( "Using some contrived information for report: \'" ).append( reportName ).append( "\'.\n" ).append(
- "\to groupId: \'maven\'\n" ).append(
- "\to artifactId: \'" ).append(
- reportPluginName ).append(
- "\'\n" ).append(
- "\to version: \'1.0-SNAPSHOT\'\n" ).append(
- "\to goal: \'report\'\n" ).append(
- "\n" ).append(
- "These values were extracted using the v3 report naming convention, but may be wrong." );
+ "\to groupId: \'maven\'\n" ).append( "\to artifactId: \'" ).append( reportPluginName ).append(
+ "\'\n" ).append( "\to version: \'1.0-SNAPSHOT\'\n" ).append( "\to goal: \'report\'\n" ).append(
+ "\n" ).append(
+ "These values were extracted using the v3 report naming convention, but may be wrong." );
reporter.warn( info.toString() );
@@ -298,8 +293,7 @@
}
private org.apache.maven.model.Organization translateOrganization(
- org.apache.maven.model.v3_0_0.Organization v3Organization,
- Reporter reporter )
+ org.apache.maven.model.v3_0_0.Organization v3Organization, Reporter reporter )
throws ReportWriteException
{
Organization organization = null;
@@ -378,7 +372,7 @@
}
private DistributionManagement translateDistributionManagement( PomKey pomKey,
- org.apache.maven.model.v3_0_0.Model v3Model )
+ org.apache.maven.model.v3_0_0.Model v3Model )
throws PomTranslationException
{
DistributionManagement distributionManagement = new DistributionManagement();
@@ -508,30 +502,30 @@
String groupId = format( v3Dep.getGroupId() );
String artifactId = format( v3Dep.getArtifactId() );
-
+
String id = format( v3Dep.getId() );
-
- if( StringUtils.isNotEmpty( id ) )
+
+ if ( StringUtils.isNotEmpty( id ) )
{
- if( StringUtils.isEmpty( groupId ) )
+ if ( StringUtils.isEmpty( groupId ) )
{
groupId = id;
}
-
- if( StringUtils.isEmpty( artifactId ) )
+
+ if ( StringUtils.isEmpty( artifactId ) )
{
artifactId = id;
}
}
String type = v3Dep.getType();
- if( "plugin".equals( type ) )
+ if ( "plugin".equals( type ) )
{
- if( "maven".equals( groupId ) )
+ if ( "maven".equals( groupId ) )
{
groupId = "org.apache.maven.plugins";
}
-
+
Plugin plugin = new Plugin();
plugin.setGroupId( groupId );
plugin.setArtifactId( artifactId );
@@ -540,36 +534,36 @@
Xpp3Dom config = new Xpp3Dom( "configuration" );
Properties props = v3Dep.getProperties();
-
+
if ( !props.isEmpty() )
{
for ( Iterator propertyIterator = props.keySet().iterator(); it.hasNext(); )
{
String key = (String) propertyIterator.next();
String value = props.getProperty( key );
-
+
Xpp3Dom child = new Xpp3Dom( key );
child.setValue( value );
-
+
config.addChild( child );
}
}
-
+
plugin.setConfiguration( config );
-
+
this.discoveredPlugins.add( plugin );
}
else
{
Dependency dep = new Dependency();
- dep.setGroupId(groupId);
- dep.setArtifactId(artifactId);
+ dep.setGroupId( groupId );
+ dep.setArtifactId( artifactId );
dep.setVersion( v3Dep.getVersion() );
dep.setType( v3Dep.getType() );
-
+
String scope = v3Dep.getProperty( "scope" );
- if( StringUtils.isNotEmpty( scope ) )
+ if ( StringUtils.isNotEmpty( scope ) )
{
dep.setScope( scope );
}
@@ -681,18 +675,18 @@
}
}
}
-
- if(!this.discoveredPlugins.isEmpty())
+
+ if ( !this.discoveredPlugins.isEmpty() )
{
- if(build == null)
+ if ( build == null )
{
build = new Build();
}
-
+
for ( Iterator it = this.discoveredPlugins.iterator(); it.hasNext(); )
{
Plugin plugin = (Plugin) it.next();
-
+
build.addPlugin( plugin );
}
}
@@ -731,12 +725,12 @@
Resource resource = new Resource();
resource.setDirectory( v3Resource.getDirectory() );
-
- List excludes = new ArrayList(v3Resource.getExcludes());
- excludes.removeAll(v3Resource.getDefaultExcludes());
-
+
+ List excludes = new ArrayList( v3Resource.getExcludes() );
+ excludes.removeAll( v3Resource.getDefaultExcludes() );
+
resource.setExcludes( excludes );
-
+
resource.setIncludes( v3Resource.getIncludes() );
resource.setTargetPath( v3Resource.getTargetPath() );
Modified: maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml?rev=164705&r1=164704&r2=164705&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml Mon Apr 25 18:32:07 2005
@@ -26,6 +26,19 @@
|
-->
<component>
+ <role>org.codehaus.plexus.mailsender.MailSender</role>
+ <implementation>org.codehaus.plexus.mailsender.simple.SimpleMailSender</implementation>
+ <configuration>
+ <smtp-host>localhost</smtp-host>
+ <smtp-port>25</smtp-port>
+ </configuration>
+ </component>
+ <!--
+ |
+ |
+ |
+ -->
+ <component>
<role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
<role-hint>alpha-bridging</role-hint>
<implementation>org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout</implementation>
@@ -143,6 +156,11 @@
<role>org.apache.maven.tools.repoclean.discover.ArtifactDiscoverer</role>
<role-hint>legacy</role-hint>
<implementation>org.apache.maven.tools.repoclean.discover.LegacyArtifactDiscoverer</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+ </requirement>
+ </requirements>
</component>
<!--
|
@@ -153,6 +171,26 @@
<role>org.apache.maven.tools.repoclean.discover.ArtifactDiscoverer</role>
<role-hint>default</role-hint>
<implementation>org.apache.maven.tools.repoclean.discover.DefaultArtifactDiscoverer</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+ </requirement>
+ </requirements>
+ </component>
+ <!--
+ |
+ |
+ |
+ -->
+ <component>
+ <role>org.apache.maven.tools.repoclean.discover.ArtifactDiscoverer</role>
+ <role-hint>alpha-bridging</role-hint>
+ <implementation>org.apache.maven.tools.repoclean.discover.DefaultArtifactDiscoverer</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+ </requirement>
+ </requirements>
</component>
<!--
|
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org