Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
View
7 shell/src/main/java/org/jboss/forge/shell/plugins/builtin/ForgePlugin.java
@@ -484,8 +484,11 @@ private Dependency getLatestAvailableDistribution()
@Override
public boolean accept(Dependency dependency)
{
- // We are only interested in versions higher than the current version
- return dependency.getVersion().compareTo(runtimeVersion) > 0;
+ // We are only interested in 1.x Final versions higher than the current version
+ // TODO: Consider the version string for 2.x and higher releases when porting.
+ String version = dependency.getVersion();
+ return version.compareTo(runtimeVersion) > 0 && version.startsWith("1.")
+ && version.endsWith(".Final");
}
}
)).setRepositories(new DependencyRepositoryImpl(DependencyFacet.KnownRepository.JBOSS_NEXUS));
View
9 shell/src/main/java/org/jboss/forge/shell/plugins/builtin/VersionPlugin.java
@@ -6,6 +6,9 @@
*/
package org.jboss.forge.shell.plugins.builtin;
+import javax.inject.Inject;
+
+import org.jboss.forge.ForgeEnvironment;
import org.jboss.forge.shell.plugins.Alias;
import org.jboss.forge.shell.plugins.DefaultCommand;
import org.jboss.forge.shell.plugins.Help;
@@ -21,10 +24,14 @@
@Help("Displays the current Forge version.")
public class VersionPlugin implements Plugin
{
+
+ @Inject
+ private ForgeEnvironment environment;
+
@DefaultCommand
public void show(final PipeOut out)
{
- String version = getClass().getPackage().getImplementationVersion();
+ String version = environment.getRuntimeVersion();
out.println("JBoss Forge, version [ " + version + " ] - JBoss, by Red Hat, Inc. [ http://jboss.org/forge ]");
}
}

No commit comments for this range

Something went wrong with that request. Please try again.