138 AbstractAppImageBuilder imageBuilder)
139 throws IOException, Exception {
140
141 List<Path> modulePath =
142 StandardBundlerParam.MODULE_PATH.fetchFrom(params);
143 Set<String> addModules =
144 StandardBundlerParam.ADD_MODULES.fetchFrom(params);
145 Set<String> limitModules =
146 StandardBundlerParam.LIMIT_MODULES.fetchFrom(params);
147 Path outputDir = imageBuilder.getRuntimeRoot();
148 File mainJar = getMainJar(params);
149 ModFile.ModType mainJarType = ModFile.ModType.Unknown;
150
151 if (mainJar != null) {
152 mainJarType = new ModFile(mainJar).getModType();
153 } else if (StandardBundlerParam.MODULE.fetchFrom(params) == null) {
154 // user specified only main class, all jars will be on the classpath
155 mainJarType = ModFile.ModType.UnnamedJar;
156 }
157
158 boolean bindServices = addModules.isEmpty();
159
160 // Modules
161 String mainModule = getMainModule(params);
162 if (mainModule == null) {
163 if (mainJarType == ModFile.ModType.UnnamedJar) {
164 if (addModules.isEmpty()) {
165 // The default for an unnamed jar is ALL_DEFAULT
166 addModules.add(ModuleHelper.ALL_DEFAULT);
167 }
168 } else if (mainJarType == ModFile.ModType.Unknown ||
169 mainJarType == ModFile.ModType.ModularJar) {
170 addModules.add(ModuleHelper.ALL_DEFAULT);
171 }
172 }
173
174 Set<String> modules = new ModuleHelper(
175 modulePath, addModules, limitModules).modules();
176
177 if (mainModule != null) {
178 modules.add(mainModule);
|
138 AbstractAppImageBuilder imageBuilder)
139 throws IOException, Exception {
140
141 List<Path> modulePath =
142 StandardBundlerParam.MODULE_PATH.fetchFrom(params);
143 Set<String> addModules =
144 StandardBundlerParam.ADD_MODULES.fetchFrom(params);
145 Set<String> limitModules =
146 StandardBundlerParam.LIMIT_MODULES.fetchFrom(params);
147 Path outputDir = imageBuilder.getRuntimeRoot();
148 File mainJar = getMainJar(params);
149 ModFile.ModType mainJarType = ModFile.ModType.Unknown;
150
151 if (mainJar != null) {
152 mainJarType = new ModFile(mainJar).getModType();
153 } else if (StandardBundlerParam.MODULE.fetchFrom(params) == null) {
154 // user specified only main class, all jars will be on the classpath
155 mainJarType = ModFile.ModType.UnnamedJar;
156 }
157
158 boolean bindServices =
159 StandardBundlerParam.BIND_SERVICES.fetchFrom(params);
160
161 // Modules
162 String mainModule = getMainModule(params);
163 if (mainModule == null) {
164 if (mainJarType == ModFile.ModType.UnnamedJar) {
165 if (addModules.isEmpty()) {
166 // The default for an unnamed jar is ALL_DEFAULT
167 addModules.add(ModuleHelper.ALL_DEFAULT);
168 }
169 } else if (mainJarType == ModFile.ModType.Unknown ||
170 mainJarType == ModFile.ModType.ModularJar) {
171 addModules.add(ModuleHelper.ALL_DEFAULT);
172 }
173 }
174
175 Set<String> modules = new ModuleHelper(
176 modulePath, addModules, limitModules).modules();
177
178 if (mainModule != null) {
179 modules.add(mainModule);
|