You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by pm...@apache.org on 2006/10/31 21:44:56 UTC
svn commit: r469646 -
/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Author: pmcmahan
Date: Tue Oct 31 12:44:56 2006
New Revision: 469646
URL: http://svn.apache.org/viewvc?view=rev&rev=469646
Log:
improve snapshot support for plugins
Modified:
geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?view=diff&rev=469646&r1=469645&r2=469646
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Tue Oct 31 12:44:56 2006
@@ -898,14 +898,12 @@
String qualifiedVersion = configId.getVersion().toString();
if (configId.getVersion() instanceof SnapshotVersion) {
- SnapshotVersion ssVersion = (SnapshotVersion)configId.getVersion();
- qualifiedVersion = ssVersion.getMajorVersion() + "." + ssVersion.getMinorVersion();
- if (ssVersion.getTimestamp()!=null) {
- qualifiedVersion += "-" + ssVersion.getTimestamp();
- }
- if (ssVersion.getBuildNumber()!=0) {
- qualifiedVersion += "-" + ssVersion.getBuildNumber();
- }
+ SnapshotVersion ssVersion = (SnapshotVersion)configId.getVersion();
+ String timestamp = ssVersion.getTimestamp();
+ int buildNumber = ssVersion.getBuildNumber();
+ if (timestamp!=null && buildNumber!=0) {
+ qualifiedVersion = qualifiedVersion.replaceAll("SNAPSHOT", timestamp + "-" + buildNumber);
+ }
}
return new URL(context, configId.getGroupId().replace('.','/') + "/"
+ configId.getArtifactId() + "/" + configId.getVersion()
@@ -932,15 +930,15 @@
* in question
*/
private static OpenResult openStream(Artifact artifact, URL[] repos, String username, String password, ResultsFileWriteMonitor monitor) throws IOException, FailedLoginException, MissingDependencyException {
- if(monitor != null) {
- monitor.getResults().setCurrentFilePercent(-1);
- monitor.getResults().setCurrentMessage("Downloading "+artifact+"...");
- monitor.setTotalBytes(-1); // In case the server doesn't say
- }
if(artifact != null) {
if (!artifact.isResolved() || artifact.getVersion().toString().indexOf("SNAPSHOT") >= 0) {
artifact = findArtifact(artifact, repos, username, password, monitor);
}
+ }
+ if(monitor != null) {
+ monitor.getResults().setCurrentFilePercent(-1);
+ monitor.getResults().setCurrentMessage("Downloading "+artifact+"...");
+ monitor.setTotalBytes(-1); // In case the server doesn't say
}
InputStream in;
LinkedList list = new LinkedList();