Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2014-11-19 23:57:52 +0000
committerJoakim Erdfelt2014-11-19 23:57:52 +0000
commitd786c4a57eab9b382957826c5284559741413df1 (patch)
tree0d23c626e99bd258933d71c95f0694bc8f9b1bec /jetty-start
parentf792c900ede4bdf7aa701c64f72c11801500049a (diff)
downloadorg.eclipse.jetty.project-d786c4a57eab9b382957826c5284559741413df1.tar.gz
org.eclipse.jetty.project-d786c4a57eab9b382957826c5284559741413df1.tar.xz
org.eclipse.jetty.project-d786c4a57eab9b382957826c5284559741413df1.zip
452322 - Restore progress messages for --add-to-start(d) use
Diffstat (limited to 'jetty-start')
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/Module.java6
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java4
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java18
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartIniBuilder.java17
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java2
-rw-r--r--jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java2
-rw-r--r--jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java13
7 files changed, 48 insertions, 14 deletions
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
index ef44a2a740..e857679193 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java
@@ -205,12 +205,6 @@ public class Module extends Node<Module>
setName(this.fileRef);
}
- @Deprecated
- public boolean isEnabled()
- {
- return isSelected();
- }
-
public boolean isVirtual()
{
return !getName().equals(fileRef);
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java b/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java
index 7de27387c7..029b299e44 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java
@@ -168,7 +168,7 @@ public class ModuleGraphWriter
private void writeModuleNode(PrintWriter out, Module module, boolean resolved)
{
String color = colorModuleBg;
- if (module.isEnabled())
+ if (module.isSelected())
{
// specifically enabled by config
color = colorEnabledBg;
@@ -183,7 +183,7 @@ public class ModuleGraphWriter
out.printf("<TABLE BORDER=\"0\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"2\">%n");
out.printf(" <TR><TD ALIGN=\"LEFT\"><B>%s</B></TD></TR>%n",module.getName());
- if (module.isEnabled())
+ if (module.isSelected())
{
writeModuleDetailHeader(out,"ENABLED");
for (Selection selection : module.getSelections())
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java
index bfa4334f2e..e60d0f9438 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java
@@ -27,8 +27,11 @@ import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import org.eclipse.jetty.start.BaseBuilder;
+import org.eclipse.jetty.start.BaseHome;
import org.eclipse.jetty.start.FS;
import org.eclipse.jetty.start.Module;
+import org.eclipse.jetty.start.StartLog;
+import org.eclipse.jetty.start.graph.OnlyTransitivePredicate;
/**
* Management of the <code>${jetty.base}/start.d/</code> based configuration.
@@ -37,11 +40,13 @@ import org.eclipse.jetty.start.Module;
*/
public class StartDirBuilder implements BaseBuilder.Config
{
+ private final BaseHome baseHome;
private final Path startDir;
public StartDirBuilder(BaseBuilder baseBuilder) throws IOException
{
- this.startDir = baseBuilder.getBaseHome().getBasePath("start.d");
+ this.baseHome = baseBuilder.getBaseHome();
+ this.startDir = baseHome.getBasePath("start.d");
FS.ensureDirectoryExists(startDir);
}
@@ -51,12 +56,19 @@ public class StartDirBuilder implements BaseBuilder.Config
if (module.isVirtual())
{
// skip, no need to reference
+ StartLog.info("%-15s skipping (virtual module)",module.getName());
return false;
}
-
- // Create start.d/{name}.ini
+ String mode = "";
+ if (module.matches(OnlyTransitivePredicate.INSTANCE))
+ {
+ mode = "(transitively) ";
+ }
+
+ // Create start.d/{name}.ini
Path ini = startDir.resolve(module.getName() + ".ini");
+ StartLog.info("%-15s initialised %sin %s",module.getName(),mode,baseHome.toShortForm(ini));
try (BufferedWriter writer = Files.newBufferedWriter(ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING))
{
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartIniBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartIniBuilder.java
index 38bc219fc0..1505b2b56a 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartIniBuilder.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartIniBuilder.java
@@ -31,8 +31,11 @@ import java.util.List;
import java.util.Set;
import org.eclipse.jetty.start.BaseBuilder;
+import org.eclipse.jetty.start.BaseHome;
import org.eclipse.jetty.start.Module;
import org.eclipse.jetty.start.Props;
+import org.eclipse.jetty.start.StartLog;
+import org.eclipse.jetty.start.graph.OnlyTransitivePredicate;
/**
* Management of the <code>${jetty.base}/start.ini</code> based configuration.
@@ -42,6 +45,7 @@ import org.eclipse.jetty.start.Props;
*/
public class StartIniBuilder implements BaseBuilder.Config
{
+ private final BaseHome baseHome;
private final Path startIni;
/* List of modules already present in start.ini */
@@ -52,7 +56,8 @@ public class StartIniBuilder implements BaseBuilder.Config
public StartIniBuilder(BaseBuilder baseBuilder) throws IOException
{
- this.startIni = baseBuilder.getBaseHome().getBasePath("start.ini");
+ this.baseHome = baseBuilder.getBaseHome();
+ this.startIni = baseHome.getBasePath("start.ini");
if (Files.exists(startIni))
{
@@ -87,6 +92,7 @@ public class StartIniBuilder implements BaseBuilder.Config
{
if (modulesPresent.contains(module.getName()))
{
+ StartLog.info("%-15s already initialised in %s",module.getName(),baseHome.toShortForm(startIni));
// skip, already present
return false;
}
@@ -94,8 +100,17 @@ public class StartIniBuilder implements BaseBuilder.Config
if (module.isVirtual())
{
// skip, no need to reference
+ StartLog.info("%-15s skipping (virtual module)",module.getName());
return false;
}
+
+ String mode = "";
+ if (module.matches(OnlyTransitivePredicate.INSTANCE))
+ {
+ mode = "(transitively) ";
+ }
+
+ StartLog.info("%-15s initialised %sin %s",module.getName(),mode,baseHome.toShortForm(startIni));
// Append to start.ini
try (BufferedWriter writer = Files.newBufferedWriter(startIni,StandardCharsets.UTF_8,StandardOpenOption.APPEND,StandardOpenOption.CREATE))
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java
index 42b3d70c5d..baf89c7ef7 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java
@@ -114,7 +114,7 @@ public class MavenLocalRepoFileInitializer extends UriFileInitializer implements
// Grab copy from local repository (download if needed to local
// repository)
Path localRepoFile = getLocalRepoFile(coords);
- StartLog.log("COPY","%s to %s",localRepoFile,file);
+ StartLog.log("COPY","%s to %s",localRepoFile,baseHome.toShortForm(file));
Files.copy(localRepoFile,file);
}
else
diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java
index de57eba28a..dc74b9c890 100644
--- a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java
+++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java
@@ -35,7 +35,7 @@ import org.eclipse.jetty.start.StartLog;
public class UriFileInitializer implements FileInitializer
{
private final static String[] SUPPORTED_SCHEMES = { "http", "https" };
- private final BaseHome baseHome;
+ protected final BaseHome baseHome;
public UriFileInitializer(BaseHome baseHome)
{
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java
index faecf5612f..28c7b688e1 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/DistTest.java
@@ -80,4 +80,17 @@ public class DistTest
execMain(cmds);
}
+
+ @Test
+ public void testLikeDistro_SetupDemoBase() throws Exception
+ {
+ File basePath = testdir.getEmptyDir();
+
+ List<String> cmds = getBaseCommandLine(basePath);
+
+ cmds.add("--add-to-start=continuation,deploy,websocket,ext,resources,client,annotations,jndi,servlets");
+ cmds.add("--add-to-startd=jsp,jstl,http,https");
+
+ execMain(cmds);
+ }
}

Back to the top