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/05/06 19:41:41 UTC
svn commit: r168631 -
/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java
Author: jdcasey
Date: Fri May 6 10:41:40 2005
New Revision: 168631
URL: http://svn.apache.org/viewcvs?rev=168631&view=rev
Log:
Fixed handling of <id>ant+optional</id> in pom-level info as well as dependencies.
Modified:
maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/translate/PomV3ToV4Translator.java
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=168631&r1=168630&r2=168631&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 Fri May 6 10:41:40 2005
@@ -65,21 +65,31 @@
String groupId = format( v3Model.getGroupId() );
String artifactId = format( v3Model.getArtifactId() );
- String id = format( v3Model.getId() );
+ String id = v3Model.getId();
+
if ( StringUtils.isNotEmpty( id ) )
{
if ( StringUtils.isEmpty( groupId ) )
{
- groupId = id;
+ int plusIdx = id.indexOf("+");
+ if(plusIdx > -1)
+ {
+ groupId = id.substring(0, plusIdx);
+ }
+ else
+ {
+ groupId = id;
+ }
}
if ( StringUtils.isEmpty( artifactId ) )
{
- artifactId = id;
+ artifactId = format( id );
}
}
String version = format( v3Model.getCurrentVersion() );
+
if ( version == null )
{
version = format( v3Model.getVersion() );
@@ -503,18 +513,27 @@
String groupId = format( v3Dep.getGroupId() );
String artifactId = format( v3Dep.getArtifactId() );
- String id = format( v3Dep.getId() );
+ String id = v3Dep.getId();
if ( StringUtils.isNotEmpty( id ) )
{
if ( StringUtils.isEmpty( groupId ) )
{
- groupId = id;
+ int plusIdx = id.indexOf("+");
+
+ if(plusIdx > -1)
+ {
+ groupId = id.substring(0, plusIdx);
+ }
+ else
+ {
+ groupId = id;
+ }
}
if ( StringUtils.isEmpty( artifactId ) )
{
- artifactId = id;
+ artifactId = format( id );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org