• R/O
  • SSH
  • HTTPS

exewrap: コミット


コミットメタ情報

リビジョン98 (tree)
日時2020-10-21 14:13:50
作者hirukawa_ryo

ログメッセージ

* exewrap-jetty 9.4.32
exewrap 1.6.4に変更しました。

変更サマリ

差分

--- exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/Main.java (revision 97)
+++ exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/Main.java (revision 98)
@@ -208,7 +208,7 @@
208208
209209 StartLog.debug("%s - %s", invokedClass, invokedClass.getPackage().getImplementationVersion());
210210
211- CommandLineBuilder cmd = args.getMainArgs(false);
211+ CommandLineBuilder cmd = args.getMainArgs(StartArgs.ARG_PARTS);
212212 String[] argArray = cmd.getArgs().toArray(new String[0]);
213213 StartLog.debug("Command Line Args: %s", cmd.toString());
214214
@@ -417,7 +417,7 @@
417417 // Show Command Line to execute Jetty
418418 if (args.isDryRun())
419419 {
420- CommandLineBuilder cmd = args.getMainArgs(true);
420+ CommandLineBuilder cmd = args.getMainArgs(args.getDryRunParts());
421421 System.out.println(cmd.toString(StartLog.isDebugEnabled() ? " \\\n" : " "));
422422 }
423423
@@ -456,7 +456,7 @@
456456 // execute Jetty in another JVM
457457 if (args.isExec())
458458 {
459- CommandLineBuilder cmd = args.getMainArgs(true);
459+ CommandLineBuilder cmd = args.getMainArgs(StartArgs.ALL_PARTS);
460460 cmd.debug();
461461 ProcessBuilder pbuilder = new ProcessBuilder(cmd.getArgs());
462462 StartLog.endStartLog();
--- exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java (revision 97)
+++ exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/ModuleGraphWriter.java (revision 98)
@@ -120,7 +120,7 @@
120120 out.println("/*");
121121 out.println(" * GraphViz Graph of Jetty Modules");
122122 out.println(" * ");
123- out.println(" * Jetty: http://eclipse.org/jetty/");
123+ out.println(" * Jetty: https://eclipse.org/jetty/");
124124 out.println(" * GraphViz: http://graphviz.org/");
125125 out.println(" * ");
126126 out.println(" * To Generate Graph image using graphviz:");
--- exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/StartArgs.java (revision 97)
+++ exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/StartArgs.java (revision 98)
@@ -57,6 +57,14 @@
5757 public class StartArgs
5858 {
5959 public static final String VERSION;
60+ public static final Set<String> ALL_PARTS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
61+ "java",
62+ "opts",
63+ "path",
64+ "main",
65+ "args")));
66+ public static final Set<String> ARG_PARTS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
67+ "args")));
6068
6169 static
6270 {
@@ -219,6 +227,7 @@
219227 private boolean listConfig = false;
220228 private boolean version = false;
221229 private boolean dryRun = false;
230+ private final Set<String> dryRunParts = new HashSet<>();
222231 private boolean jpms = false;
223232 private boolean createStartd = false;
224233 private boolean updateIni = false;
@@ -675,8 +684,11 @@
675684 return jvmArgs;
676685 }
677686
678- public CommandLineBuilder getMainArgs(boolean addJavaInit) throws IOException
687+ public CommandLineBuilder getMainArgs(Set<String> parts) throws IOException
679688 {
689+ if (parts.isEmpty())
690+ parts = ALL_PARTS;
691+
680692 CommandLineBuilder cmd = new CommandLineBuilder();
681693
682694 // Special Stop/Shutdown properties
@@ -684,10 +696,11 @@
684696 ensureSystemPropertySet("STOP.KEY");
685697 ensureSystemPropertySet("STOP.WAIT");
686698
687- if (addJavaInit)
688- {
699+ if (parts.contains("java"))
689700 cmd.addRawArg(CommandLineBuilder.findJavaBin());
690701
702+ if (parts.contains("opts"))
703+ {
691704 cmd.addRawArg("-Djava.io.tmpdir=" + System.getProperty("java.io.tmpdir"));
692705 cmd.addRawArg("-Djetty.home=" + baseHome.getHome());
693706 cmd.addRawArg("-Djetty.base=" + baseHome.getBase());
@@ -702,6 +715,7 @@
702715
703716 Prop p = processSystemProperty(key, value, null);
704717 cmd.addRawArg("-D" + p.key + "=" + getProperties().expand(p.value));
718+
705719 }
706720 else
707721 {
@@ -715,7 +729,10 @@
715729 String value = System.getProperty(propKey);
716730 cmd.addEqualsArg("-D" + propKey, value);
717731 }
732+ }
718733
734+ if (parts.contains("path"))
735+ {
719736 if (isJPMS())
720737 {
721738 Map<Boolean, List<File>> dirsAndFiles = StreamSupport.stream(classpath.spliterator(), false)
@@ -764,54 +781,60 @@
764781 cmd.addRawArg("--add-reads");
765782 cmd.addRawArg(entry.getKey() + "=" + String.join(",", entry.getValue()));
766783 }
767-
768- cmd.addRawArg("--module");
769- cmd.addRawArg(getMainClassname());
770784 }
771785 else
772786 {
773787 cmd.addRawArg("-cp");
774788 cmd.addRawArg(classpath.toString());
775- cmd.addRawArg(getMainClassname());
776789 }
777790 }
778791
792+ if (parts.contains("main"))
793+ {
794+ if (isJPMS())
795+ cmd.addRawArg("--module");
796+ cmd.addRawArg(getMainClassname());
797+ }
798+
779799 // pass properties as args or as a file
780- if (dryRun && execProperties == null)
800+ if (parts.contains("args"))
781801 {
782- for (Prop p : properties)
802+ if (dryRun && execProperties == null)
783803 {
784- cmd.addRawArg(CommandLineBuilder.quote(p.key) + "=" + CommandLineBuilder.quote(p.value));
804+ for (Prop p : properties)
805+ {
806+ cmd.addRawArg(CommandLineBuilder.quote(p.key) + "=" + CommandLineBuilder.quote(p.value));
807+ }
785808 }
786- }
787- else if (properties.size() > 0)
788- {
789- Path propPath;
790- if (execProperties == null)
809+ else if (properties.size() > 0)
791810 {
792- propPath = Files.createTempFile("start_", ".properties");
793- propPath.toFile().deleteOnExit();
811+ Path propPath;
812+ if (execProperties == null)
813+ {
814+ propPath = Files.createTempFile("start_", ".properties");
815+ propPath.toFile().deleteOnExit();
816+ }
817+ else
818+ propPath = new File(execProperties).toPath();
819+
820+ try (OutputStream out = Files.newOutputStream(propPath))
821+ {
822+ properties.store(out, "start.jar properties");
823+ }
824+ cmd.addRawArg(propPath.toAbsolutePath().toString());
794825 }
795- else
796- propPath = new File(execProperties).toPath();
797826
798- try (OutputStream out = Files.newOutputStream(propPath))
827+ for (Path xml : xmls)
799828 {
800- properties.store(out, "start.jar properties");
829+ cmd.addRawArg(xml.toAbsolutePath().toString());
801830 }
802- cmd.addRawArg(propPath.toAbsolutePath().toString());
803- }
804831
805- for (Path xml : xmls)
806- {
807- cmd.addRawArg(xml.toAbsolutePath().toString());
832+ for (Path propertyFile : propertyFiles)
833+ {
834+ cmd.addRawArg(propertyFile.toAbsolutePath().toString());
835+ }
808836 }
809837
810- for (Path propertyFile : propertyFiles)
811- {
812- cmd.addRawArg(propertyFile.toAbsolutePath().toString());
813- }
814-
815838 return cmd;
816839 }
817840
@@ -935,6 +958,11 @@
935958 return dryRun;
936959 }
937960
961+ public Set<String> getDryRunParts()
962+ {
963+ return dryRunParts;
964+ }
965+
938966 public boolean isExec()
939967 {
940968 return exec;
@@ -1152,6 +1180,21 @@
11521180 return;
11531181 }
11541182
1183+ if (arg.startsWith("--dry-run="))
1184+ {
1185+ int colon = arg.indexOf('=');
1186+ for (String part : arg.substring(colon + 1).split(","))
1187+ {
1188+ if (!ALL_PARTS.contains(part))
1189+ throw new UsageException(UsageException.ERR_BAD_ARG, "Unrecognized --dry-run=\"%s\" in %s", part, source);
1190+
1191+ dryRunParts.add(part);
1192+ }
1193+ dryRun = true;
1194+ run = false;
1195+ return;
1196+ }
1197+
11551198 // Enable forked execution of Jetty server
11561199 if ("--exec".equals(arg))
11571200 {
--- exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/usage.txt (revision 97)
+++ exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/start/usage.txt (revision 98)
@@ -23,8 +23,31 @@
2323
2424 --dry-run Print the command line that the start.jar generates,
2525 then exit. This may be used to generate command lines
26- when the start.ini includes -X or -D arguments.
26+ when the start.ini includes -X or -D arguments:
2727
28+ java -jar start.jar --dry-run > jetty.sh
29+ . jetty.sh
30+
31+ --dry-run=parts Print specific parts of the command line. The parts
32+ are a comma separated list of
33+ o "java" - the JVM to run
34+ o "opts" - the JVM options (eg -D and -X flags)
35+ o "path" - the JVM class path or JPMS modules options
36+ o "main" - the main class to run
37+ o "args" - the arguments passed to the main class
38+
39+ It is possible to decompose the start command:
40+
41+ OPTS=$(java -jar start.jar --dry-run=opts,path)
42+ MAIN=$(java -jar start.jar --dry-run=main)
43+ ARGS=$(java -jar start.jar --dry-run=args)
44+ java $OPTS -Dextra=opt $MAIN $ARGS extra=arg
45+
46+ Alternatively to create an args file for java:
47+
48+ java -jar start.jar --dry-run=opts,path,main,args > /tmp/args
49+ java @/tmp/args
50+
2851 --exec Run the generated command line (see --dry-run) in
2952 a sub process. This can be used when start.ini
3053 contains -X or -D arguments, but creates an extra
@@ -46,7 +69,7 @@
4669 --debug Enable debug output of the startup procedure.
4770 Note: this does not setup debug for Jetty itself.
4871 If you want debug for Jetty, configure your logging.
49- http://www.eclipse.org/jetty/documentation/
72+ https://www.eclipse.org/jetty/documentation/
5073
5174 --start-log-file=<filename>
5275 A filename, relative to ${jetty.base}, where all startup
@@ -54,7 +77,6 @@
5477 issues where the jetty specific logger has not yet kicked
5578 in due to startup configuration errors.
5679
57-
5880 Module Management:
5981 ------------------
6082
@@ -156,8 +178,6 @@
156178 The url to use to download Maven dependencies.
157179 Default is https://repo1.maven.org/maven2/.
158180
159-
160-
161181 Properties:
162182 -----------
163183 Properties are used to parameterize:
@@ -195,7 +215,6 @@
195215 maven.repo.uri=[url] default https://repo1.maven.org/maven2/.
196216 The url to use to download Maven dependencies.
197217
198-
199218 Service Options:
200219 ----------------
201220
@@ -219,7 +238,6 @@
219238 remove-options:
220239 -s stop service.
221240
222-
223241 Defaults:
224242 ---------
225243
@@ -237,4 +255,4 @@
237255 5) <jetty-dir>/start.d/*.ini
238256
239257 For more information on startup, see the online documentation at
240- http://www.eclipse.org/jetty/documentation/
258+ https://www.eclipse.org/jetty/documentation/
--- exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/util/ManifestUtils.java (revision 97)
+++ exewrap-jetty/trunk/src/main/java/org/eclipse/jetty/util/ManifestUtils.java (revision 98)
@@ -64,7 +64,6 @@
6464 * @param klass the class of the jar/module to retrieve the version
6565 * @return the jar/module version, or an empty Optional
6666 */
67- @SuppressWarnings("unchecked")
6867 public static Optional<String> getVersion(Class<?> klass)
6968 {
7069 Optional<String> version = getManifest(klass).map(Manifest::getMainAttributes)
--- exewrap-jetty/trunk/src/main/resources/META-INF/maven/org.eclipse.jetty/jetty-start/pom.xml (revision 97)
+++ exewrap-jetty/trunk/src/main/resources/META-INF/maven/org.eclipse.jetty/jetty-start/pom.xml (revision 98)
@@ -2,13 +2,12 @@
22 <parent>
33 <groupId>org.eclipse.jetty</groupId>
44 <artifactId>jetty-project</artifactId>
5- <version>9.4.30.v20200611</version>
5+ <version>9.4.32.v20200930</version>
66 </parent>
77 <modelVersion>4.0.0</modelVersion>
88 <artifactId>jetty-start</artifactId>
99 <name>Jetty :: Start</name>
1010 <description>The start utility</description>
11- <url>http://www.eclipse.org/jetty</url>
1211 <properties>
1312 <bundle-symbolic-name>${project.groupId}.start</bundle-symbolic-name>
1413 </properties>
旧リポジトリブラウザで表示