Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2014-10-28 17:28:17 +0000
committerJoakim Erdfelt2014-10-28 17:28:17 +0000
commitaf5f9382a4f063f36c0fdc95121bfb597a91a4c9 (patch)
treef671d4bd17f9e634f59aebd0e404b1b8262f71cd /jetty-start
parentf4f600ff056c9808543619d1cc47987ec9cd4a24 (diff)
downloadorg.eclipse.jetty.project-af5f9382a4f063f36c0fdc95121bfb597a91a4c9.tar.gz
org.eclipse.jetty.project-af5f9382a4f063f36c0fdc95121bfb597a91a4c9.tar.xz
org.eclipse.jetty.project-af5f9382a4f063f36c0fdc95121bfb597a91a4c9.zip
449001 - Remove start.d directory from JETTY_HOME
+ Reworking warning to be optional but still start Jetty also. + Leaving start.d out of {jetty.home} still.
Diffstat (limited to 'jetty-start')
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/BaseHomeWarning.java29
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/Main.java6
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java5
-rw-r--r--jetty-start/src/main/resources/org/eclipse/jetty/start/base-home-warning.txt19
4 files changed, 44 insertions, 15 deletions
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHomeWarning.java b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHomeWarning.java
index 0c4c6b8a31..bd1fc70561 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHomeWarning.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHomeWarning.java
@@ -18,17 +18,34 @@
package org.eclipse.jetty.start;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jetty.start.Props.Prop;
public class BaseHomeWarning
{
- public static void main(String[] args)
+ public static void show(Props props)
{
- if(!Main.printTextResource("org/eclipse/jetty/start/base-home-warning.txt"))
+ Prop showWarn = props.getProp("org.eclipse.jetty.start.home.warning",true);
+ if (showWarn == null || Boolean.parseBoolean(showWarn.value))
{
- StartLog.warn("It is not recommended to run Jetty from within {jetty.home}");
- StartLog.warn("Use proper {jetty.base} setup");
- StartLog.warn("See: http://www.eclipse.org/jetty/documentation/current/startup.html");
+ if (!Main.printTextResource("org/eclipse/jetty/start/base-home-warning.txt"))
+ {
+ StartLog.warn("It is not recommended to run Jetty from within {jetty.home}");
+ StartLog.warn("Use a proper {jetty.base} setup");
+ StartLog.warn("See: http://www.eclipse.org/jetty/documentation/current/startup.html");
+ }
+
+ try
+ {
+ System.err.print("Your startup will proceed shortly ...");
+ TimeUnit.SECONDS.sleep(2);
+ System.err.println();
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
}
- System.exit(-1);
}
}
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
index 65c5a29bfe..ba0e2aa681 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java
@@ -779,6 +779,12 @@ public class Main
{
return;
}
+
+ // Warning Message
+ if (!baseHome.isBaseDifferent() && args.isNormalMainClass())
+ {
+ BaseHomeWarning.show(args.getProperties());
+ }
// execute Jetty in another JVM
if (args.isExec())
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java
index ecca0a6afb..74659fb941 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java
@@ -603,6 +603,11 @@ public class StartArgs
{
return exec;
}
+
+ public boolean isNormalMainClass()
+ {
+ return SERVER_MAIN.equals(getMainClassname());
+ }
public boolean isHelp()
{
diff --git a/jetty-start/src/main/resources/org/eclipse/jetty/start/base-home-warning.txt b/jetty-start/src/main/resources/org/eclipse/jetty/start/base-home-warning.txt
index c0fa8298ba..a34bfdba7e 100644
--- a/jetty-start/src/main/resources/org/eclipse/jetty/start/base-home-warning.txt
+++ b/jetty-start/src/main/resources/org/eclipse/jetty/start/base-home-warning.txt
@@ -1,15 +1,16 @@
-WARNING
--------
+============================================================================
+WARNING: Jetty is starting using LEGACY behavior.
-While it is possible to run Jetty from within {jetty.home},
-it is not recommended that you run Jetty this way.
+A proper {jetty.base} should be configured with no changes being made to the {jetty.home} directory.
-Please setup a proper {jetty.base}.
+Please see http://www.eclipse.org/jetty/documentation/current/startup.html
-See http://www.eclipse.org/jetty/documentation/current/startup.html
+A demo-base directory has been provided as an example of this setup.
-The demo-base has been provided to you for an example of this kind of setup.
+ $ cd demo-base
+ $ java -jar ../start.jar
- $ cd demo-base
- $ java -jar ../start.jar
+This warning may be disabled by setting the system property
+ -Dorg.eclipse.jetty.start.home.warning=false
+============================================================================

Back to the top