451973 - Ambiguous module init location when mixing --add-to-start & --add-to-startd in the same exec
+ In case of ambiguous selection, defaults to start.ini, with warning message
This commit is contained in:
parent
b8e062bd51
commit
d9ffed0a07
|
@ -157,25 +157,20 @@ public class BaseBuilder
|
||||||
|
|
||||||
if (ambiguous.size() > 0)
|
if (ambiguous.size() > 0)
|
||||||
{
|
{
|
||||||
StringBuilder err = new StringBuilder();
|
StringBuilder warn = new StringBuilder();
|
||||||
err.append("Unable to add ");
|
warn.append("Ambiguous module locations detected, defaulting to --add-to-start for the following module selections:");
|
||||||
err.append(ambiguous.size());
|
warn.append(" [");
|
||||||
err.append(" module");
|
|
||||||
if (ambiguous.size() > 1)
|
|
||||||
{
|
|
||||||
err.append('s');
|
|
||||||
}
|
|
||||||
err.append(" (found declared via both --add-to-start and --add-to-startd): [");
|
|
||||||
for (int i = 0; i < ambiguous.size(); i++)
|
for (int i = 0; i < ambiguous.size(); i++)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
err.append(", ");
|
warn.append(", ");
|
||||||
}
|
}
|
||||||
err.append(ambiguous.get(i).getName());
|
warn.append(ambiguous.get(i).getName());
|
||||||
}
|
}
|
||||||
err.append(']');
|
warn.append(']');
|
||||||
throw new RuntimeException(err.toString());
|
StartLog.warn(warn.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
StartLog.debug("Adding %s new module(s)",count);
|
StartLog.debug("Adding %s new module(s)",count);
|
||||||
|
@ -198,6 +193,11 @@ public class BaseBuilder
|
||||||
StartDirBuilder builder = new StartDirBuilder(this);
|
StartDirBuilder builder = new StartDirBuilder(this);
|
||||||
for (Module mod : startDModules)
|
for (Module mod : startDModules)
|
||||||
{
|
{
|
||||||
|
if (ambiguous.contains(mod))
|
||||||
|
{
|
||||||
|
// skip ambiguous module
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dirty |= builder.addModule(mod);
|
dirty |= builder.addModule(mod);
|
||||||
for (String file : mod.getFiles())
|
for (String file : mod.getFiles())
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,14 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.start.graph;
|
package org.eclipse.jetty.start.graph;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a selection technique.
|
||||||
|
* <p>
|
||||||
|
* Each <code>Selection</code> can be used [0..n] times in the graph.
|
||||||
|
* The <code>Selection</code> must contain a unique 'how' description that represents
|
||||||
|
* how this selection was determined (what criteria the selection underwent)
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
public class Selection
|
public class Selection
|
||||||
{
|
{
|
||||||
private final boolean explicit;
|
private final boolean explicit;
|
||||||
|
@ -77,6 +85,9 @@ public class Selection
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get how this node was selected.
|
||||||
|
*/
|
||||||
public String getHow()
|
public String getHow()
|
||||||
{
|
{
|
||||||
return how;
|
return how;
|
||||||
|
|
Loading…
Reference in New Issue