summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-04-15 08:32:31 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-15 08:32:31 -0400
commitcc26656d8deaf8ebe552897480240a7665b0fb76 (patch)
tree0f225c12af7705030524060540ddcaed8a796744
parent289917bb90ee30fb357a3646ba0d40ceacf7e5ed (diff)
downloadgitblit-cc26656d8deaf8ebe552897480240a7665b0fb76.tar.gz
gitblit-cc26656d8deaf8ebe552897480240a7665b0fb76.zip
Update to pf4j 0.8.0
-rw-r--r--.classpath2
-rw-r--r--build.moxie2
-rw-r--r--gitblit.iml6
-rw-r--r--src/main/java/com/gitblit/models/PluginRegistry.java8
-rw-r--r--src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java32
5 files changed, 25 insertions, 25 deletions
diff --git a/.classpath b/.classpath
index 6b0d864e..a66d9344 100644
--- a/.classpath
+++ b/.classpath
@@ -75,7 +75,7 @@
<classpathentry kind="lib" path="ext/args4j-2.0.26.jar" sourcepath="ext/src/args4j-2.0.26.jar" />
<classpathentry kind="lib" path="ext/jedis-2.3.1.jar" sourcepath="ext/src/jedis-2.3.1.jar" />
<classpathentry kind="lib" path="ext/commons-pool2-2.0.jar" sourcepath="ext/src/commons-pool2-2.0.jar" />
- <classpathentry kind="lib" path="ext/pf4j-0.7.1.jar" sourcepath="ext/src/pf4j-0.7.1.jar" />
+ <classpathentry kind="lib" path="ext/pf4j-0.8.0.jar" sourcepath="ext/src/pf4j-0.8.0.jar" />
<classpathentry kind="lib" path="ext/junit-4.11.jar" sourcepath="ext/src/junit-4.11.jar" />
<classpathentry kind="lib" path="ext/hamcrest-core-1.3.jar" sourcepath="ext/src/hamcrest-core-1.3.jar" />
<classpathentry kind="lib" path="ext/selenium-java-2.28.0.jar" sourcepath="ext/src/selenium-java-2.28.0.jar" />
diff --git a/build.moxie b/build.moxie
index 0f7ac81f..37592ba8 100644
--- a/build.moxie
+++ b/build.moxie
@@ -173,7 +173,7 @@ dependencies:
- compile 'args4j:args4j:2.0.26' :war :fedclient :authority
- compile 'commons-codec:commons-codec:1.7' :war
- compile 'redis.clients:jedis:2.3.1' :war
-- compile 'ro.fortsoft.pf4j:pf4j:0.7.1' :war
+- compile 'ro.fortsoft.pf4j:pf4j:0.8.0' :war
- test 'junit'
# Dependencies for Selenium web page testing
- test 'org.seleniumhq.selenium:selenium-java:${selenium.version}' @jar
diff --git a/gitblit.iml b/gitblit.iml
index 69bd8e46..4712798f 100644
--- a/gitblit.iml
+++ b/gitblit.iml
@@ -780,13 +780,13 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="pf4j-0.7.1.jar">
+ <library name="pf4j-0.8.0.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/pf4j-0.7.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/pf4j-0.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/pf4j-0.7.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/pf4j-0.8.0.jar!/" />
</SOURCES>
</library>
</orderEntry>
diff --git a/src/main/java/com/gitblit/models/PluginRegistry.java b/src/main/java/com/gitblit/models/PluginRegistry.java
index 7c1927f5..ef463163 100644
--- a/src/main/java/com/gitblit/models/PluginRegistry.java
+++ b/src/main/java/com/gitblit/models/PluginRegistry.java
@@ -23,7 +23,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.parboiled.common.StringUtils;
-import ro.fortsoft.pf4j.PluginVersion;
+import ro.fortsoft.pf4j.Version;
/**
* Represents a list of plugin registrations.
@@ -125,8 +125,8 @@ public class PluginRegistry implements Serializable {
if (StringUtils.isEmpty(installedRelease)) {
return InstallState.NOT_INSTALLED;
}
- PluginVersion ir = PluginVersion.createVersion(installedRelease);
- PluginVersion cr = PluginVersion.createVersion(currentRelease);
+ Version ir = Version.createVersion(installedRelease);
+ Version cr = Version.createVersion(currentRelease);
switch (ir.compareTo(cr)) {
case -1:
return InstallState.UNKNOWN;
@@ -151,7 +151,7 @@ public class PluginRegistry implements Serializable {
@Override
public int compareTo(PluginRelease o) {
- return PluginVersion.createVersion(version).compareTo(PluginVersion.createVersion(o.version));
+ return Version.createVersion(version).compareTo(Version.createVersion(o.version));
}
}
}
diff --git a/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java b/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java
index f5b68548..70dc5130 100644
--- a/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java
+++ b/src/main/java/com/gitblit/transport/ssh/commands/PluginDispatcher.java
@@ -75,7 +75,7 @@ public class PluginDispatcher extends DispatchCommand {
protected void asTable(List<PluginWrapper> list) {
String[] headers;
if (verbose) {
- String [] h = { "#", "Id", "Description", "Version", "Requires", "State", "Path", "Provider"};
+ String [] h = { "#", "Id", "Description", "Version", "Requires", "State", "Path" };
headers = h;
} else {
String [] h = { "#", "Id", "Version", "State", "Path"};
@@ -86,7 +86,7 @@ public class PluginDispatcher extends DispatchCommand {
PluginWrapper p = list.get(i);
PluginDescriptor d = p.getDescriptor();
if (verbose) {
- data[i] = new Object[] { "" + (i + 1), d.getPluginId(), null/*d.getDescription()*/, d.getVersion(), null/*d.getRequires()*/, p.getPluginState(), p.getPluginPath(), d.getProvider() };
+ data[i] = new Object[] { "" + (i + 1), d.getPluginId(), d.getPluginDescription(), d.getVersion(), d.getRequires(), p.getPluginState(), p.getPluginPath() };
} else {
data[i] = new Object[] { "" + (i + 1), d.getPluginId(), d.getVersion(), p.getPluginState(), p.getPluginPath() };
}
@@ -100,7 +100,7 @@ public class PluginDispatcher extends DispatchCommand {
for (PluginWrapper pw : list) {
PluginDescriptor d = pw.getDescriptor();
if (verbose) {
- outTabbed(d.getPluginId(), null/*d.getDescription()*/, d.getVersion(), null/*d.getRequires()*/, pw.getPluginState(), pw.getPluginPath(), d.getProvider());
+ outTabbed(d.getPluginId(), d.getPluginDescription(), d.getVersion(), d.getRequires(), pw.getPluginState(), pw.getPluginPath());
} else {
outTabbed(d.getPluginId(), d.getVersion(), pw.getPluginState(), pw.getPluginPath());
}
@@ -157,7 +157,7 @@ public class PluginDispatcher extends DispatchCommand {
if (PluginState.STARTED.equals(state)) {
stdout.println(String.format("Started %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to start %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to start %s", pluginWrapper.getPluginId()));
}
}
}
@@ -185,7 +185,7 @@ public class PluginDispatcher extends DispatchCommand {
if (PluginState.STOPPED.equals(state)) {
stdout.println(String.format("Stopped %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to stop %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to stop %s", pluginWrapper.getPluginId()));
}
}
}
@@ -208,7 +208,7 @@ public class PluginDispatcher extends DispatchCommand {
if (gitblit.enablePlugin(pluginWrapper.getPluginId())) {
stdout.println(String.format("Enabled %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to enable %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to enable %s", pluginWrapper.getPluginId()));
}
}
}
@@ -230,7 +230,7 @@ public class PluginDispatcher extends DispatchCommand {
if (gitblit.disablePlugin(pluginWrapper.getPluginId())) {
stdout.println(String.format("Disabled %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to disable %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to disable %s", pluginWrapper.getPluginId()));
}
}
}
@@ -258,9 +258,9 @@ public class PluginDispatcher extends DispatchCommand {
protected String buildFieldTable(PluginWrapper pw, PluginRegistration reg) {
final String id = pw == null ? reg.id : pw.getPluginId();
- final String description = reg == null ? ""/*pw.getDescriptor().getDescription()*/ : reg.description;
+ final String description = reg == null ? pw.getDescriptor().getPluginDescription() : reg.description;
final String version = pw == null ? reg.getCurrentRelease().version : pw.getDescriptor().getVersion().toString();
- final String requires = pw == null ? reg.getCurrentRelease().requires : ""/*pw.getDescriptor().getRequires().toString()*/;
+ final String requires = pw == null ? reg.getCurrentRelease().requires : pw.getDescriptor().getRequires().toString();
final String provider = pw == null ? reg.provider : pw.getDescriptor().getProvider();
final String registry = reg == null ? "" : reg.registry;
final String path = pw == null ? "" : pw.getPluginPath();
@@ -516,7 +516,7 @@ public class PluginDispatcher extends DispatchCommand {
if (gitblit.installPlugin(urlOrId, !disableChecksum)) {
stdout.println(String.format("Installed %s", urlOrId));
} else {
- new Failure(1, String.format("Failed to install %s", urlOrId));
+ new UnloggedFailure(1, String.format("Failed to install %s", urlOrId));
}
} else {
PluginRelease pv = gitblit.lookupRelease(urlOrId, version);
@@ -526,12 +526,12 @@ public class PluginDispatcher extends DispatchCommand {
if (gitblit.installPlugin(pv.url, !disableChecksum)) {
stdout.println(String.format("Installed %s", urlOrId));
} else {
- throw new Failure(1, String.format("Failed to install %s", urlOrId));
+ throw new UnloggedFailure(1, String.format("Failed to install %s", urlOrId));
}
}
} catch (IOException e) {
log.error("Failed to install " + urlOrId, e);
- throw new Failure(1, String.format("Failed to install %s", urlOrId), e);
+ throw new UnloggedFailure(1, String.format("Failed to install %s", urlOrId), e);
}
}
}
@@ -558,18 +558,18 @@ public class PluginDispatcher extends DispatchCommand {
PluginRelease pv = gitblit.lookupRelease(pluginWrapper.getPluginId(), version);
if (pv == null) {
- throw new Failure(1, String.format("Plugin \"%s\" is not in the registry!", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Plugin \"%s\" is not in the registry!", pluginWrapper.getPluginId()));
}
try {
if (gitblit.upgradePlugin(pluginWrapper.getPluginId(), pv.url, !disableChecksum)) {
stdout.println(String.format("Upgraded %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to upgrade %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to upgrade %s", pluginWrapper.getPluginId()));
}
} catch (IOException e) {
log.error("Failed to upgrade " + pluginWrapper.getPluginId(), e);
- throw new Failure(1, String.format("Failed to upgrade %s", pluginWrapper.getPluginId()), e);
+ throw new UnloggedFailure(1, String.format("Failed to upgrade %s", pluginWrapper.getPluginId()), e);
}
}
}
@@ -591,7 +591,7 @@ public class PluginDispatcher extends DispatchCommand {
if (gitblit.deletePlugin(pluginWrapper.getPluginId())) {
stdout.println(String.format("Uninstalled %s", pluginWrapper.getPluginId()));
} else {
- throw new Failure(1, String.format("Failed to uninstall %s", pluginWrapper.getPluginId()));
+ throw new UnloggedFailure(1, String.format("Failed to uninstall %s", pluginWrapper.getPluginId()));
}
}
}