-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
952 additions
and
1,246 deletions.
There are no files selected for viewing
49 changes: 18 additions & 31 deletions
49
maven-repository-provisioner/src/main/java/com/simpligility/maven/Gav.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,67 @@ | ||
/** | ||
/** | ||
* Copyright simpligility technologies inc. http://www.simpligility.com | ||
* Licensed under Eclipse Public License - v 1.0 http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package com.simpligility.maven; | ||
|
||
public final class Gav | ||
{ | ||
public final class Gav { | ||
private final String groupId; | ||
|
||
private final String artifactId; | ||
|
||
private final String version; | ||
|
||
private final String packaging; | ||
|
||
public Gav( String groupId, String artifactId, String version, String packaging ) | ||
{ | ||
public Gav(String groupId, String artifactId, String version, String packaging) { | ||
this.groupId = groupId; | ||
this.artifactId = artifactId; | ||
this.version = version; | ||
this.packaging = packaging; | ||
} | ||
|
||
public String getGroupId() | ||
{ | ||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public String getArtifactId() | ||
{ | ||
public String getArtifactId() { | ||
return artifactId; | ||
} | ||
|
||
public String getVersion() | ||
{ | ||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
public String getPackaging() | ||
{ | ||
public String getPackaging() { | ||
return packaging; | ||
} | ||
|
||
public String getPomFilename() | ||
{ | ||
public String getPomFilename() { | ||
return getFilenameStart() + "." + MavenConstants.POM; | ||
} | ||
|
||
public String getJarFilename() | ||
{ | ||
public String getJarFilename() { | ||
return getFilenameStart() + "." + MavenConstants.JAR; | ||
} | ||
|
||
public String getFilenameStart() | ||
{ | ||
public String getFilenameStart() { | ||
return artifactId + "-" + version; | ||
} | ||
|
||
public String getSourceFilename() | ||
{ | ||
public String getSourceFilename() { | ||
return getFilenameStart() + MavenConstants.SOURCES_JAR; | ||
} | ||
|
||
public String getJavadocFilename() | ||
{ | ||
public String getJavadocFilename() { | ||
return getFilenameStart() + MavenConstants.JAVADOC_JAR; | ||
} | ||
|
||
public String getRepositoryURLPath() | ||
{ | ||
return groupId.replace( ".", "/" ) + "/" + artifactId + "/" + version + "/"; | ||
|
||
public String getRepositoryURLPath() { | ||
return groupId.replace(".", "/") + "/" + artifactId + "/" + version + "/"; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
public String toString() { | ||
return groupId + ":" + artifactId + ":" + version; | ||
} | ||
} | ||
} |
26 changes: 11 additions & 15 deletions
26
maven-repository-provisioner/src/main/java/com/simpligility/maven/GavUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
/** | ||
/** | ||
* Copyright simpligility technologies inc. http://www.simpligility.com | ||
* Licensed under Eclipse Public License - v 1.0 http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package com.simpligility.maven; | ||
|
||
import java.io.File; | ||
|
||
public class GavUtil | ||
{ | ||
public class GavUtil { | ||
|
||
public static Gav getGavFromRepositoryPath( String leafRepoPath ) | ||
{ | ||
public static Gav getGavFromRepositoryPath(String leafRepoPath) { | ||
|
||
int versionStartSlash = leafRepoPath.lastIndexOf( File.separator ); | ||
String version = leafRepoPath.substring( versionStartSlash + 1, leafRepoPath.length() ); | ||
int versionStartSlash = leafRepoPath.lastIndexOf(File.separator); | ||
String version = leafRepoPath.substring(versionStartSlash + 1, leafRepoPath.length()); | ||
|
||
String gaPath = leafRepoPath.substring( 0, versionStartSlash ); | ||
int gaStartSlash = gaPath.lastIndexOf( File.separator ); | ||
String artifactId = gaPath.substring( gaStartSlash + 1, gaPath.length() ); | ||
String gaPath = leafRepoPath.substring(0, versionStartSlash); | ||
int gaStartSlash = gaPath.lastIndexOf(File.separator); | ||
String artifactId = gaPath.substring(gaStartSlash + 1, gaPath.length()); | ||
|
||
String gPath = gaPath.substring( 0, gaStartSlash ); | ||
String groupId = gPath.replace( File.separator, "." ); | ||
String gPath = gaPath.substring(0, gaStartSlash); | ||
String groupId = gPath.replace(File.separator, "."); | ||
|
||
return new Gav( groupId, artifactId, version, null ); | ||
return new Gav(groupId, artifactId, version, null); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.