File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/main/java/com/akathist/maven/plugins/launch4j Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,18 @@ public class Launch4jMojo extends AbstractMojo {
286286 @ Parameter
287287 private File manifest ;
288288
289+ /**
290+ * If set to true it will save final config into a XML file
291+ */
292+ @ Parameter (defaultValue = "false" )
293+ private boolean saveConfig = false ;
294+
295+ /**
296+ * If {@link #saveConfig} is set to true, config will be written to this file
297+ */
298+ @ Parameter (defaultValue = "${project.build.directory}/launch4j-config.xml" )
299+ private File configOutfile ;
300+
289301 private File getJar () {
290302 return new File (jar );
291303 }
@@ -404,6 +416,14 @@ public void execute() throws MojoExecutionException {
404416 getLog ().error (e );
405417 throw new MojoExecutionException ("Failed to build the executable; please verify your configuration." , e );
406418 }
419+
420+ if (saveConfig ) {
421+ try {
422+ ConfigPersister .getInstance ().save (configOutfile );
423+ } catch (ConfigPersisterException e ) {
424+ throw new MojoExecutionException ("Cannot save config into a XML file" , e );
425+ }
426+ }
407427 }
408428
409429 /**
You can’t perform that action at this time.
0 commit comments