protected boolean executeGenerator() throws MojoExecutionException {

		// Add resources and output directory to plugins classpath
		List<Object> classpathEntries = new ArrayList<Object>();
		classpathEntries.addAll(project.getResources());
		classpathEntries.add(project.getBuild().getOutputDirectory());
		extendPluginClasspath(classpathEntries);

		// Prepare properties for the code generator
		Properties generatorProperties = new Properties();

		// Set properties defined properties in the plugins
		if (properties != null) {
			for (String key : properties.keySet()) {
				generatorProperties.setProperty(key, properties.get(key));
			}
		}

		// Set properties with output slot paths
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_SRC", outletSrcOnceDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_RESOURCES", outletResOnceDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_SRC", outletSrcDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_RESOURCES", outletResDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_WEBROOT", outletWebrootDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_SRC_TEST", outletSrcTestOnceDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_RESOURCES_TEST", outletResTestOnceDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_SRC_TEST", outletSrcTestDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_RESOURCES_TEST", outletResTestDir.toString());
		generatorProperties.setProperty(OUTPUT_SLOT_PATH_PREFIX + "TO_DOC", outletDocDir.toString());

		// Execute commandline and retrieve list of generated files
		List<File> generatedFiles = doRunGenerator(generatorProperties);
		if (generatedFiles != null) {

			// If the code generation succeeded then write status file (and refresh Eclipse workspace) else delete generated files 
			if (isVerbose()) {
				for (File generatedFile : generatedFiles) {
					getLog().info("Generated: " + getProjectRelativePath(generatedFile));
				}
			}
			updateStatusFile(generatedFiles);
			if (generatedFiles.size() > 0) {
				refreshEclipseWorkspace();
			}
			getLog().info("Generated " + generatedFiles.size() + " files");
			return true;
		} else {
			getLog().error("Executing generator workflow failed");
		}
		return false;
	}
protected boolean executeGenerator ( ) throws MojoExecutionException { List < Object > classpathEntries = new ArrayList < Object > ( ) ; classpathEntries . addAll ( project . getResources ( ) ) ; classpathEntries . add ( project . getBuild ( ) . getOutputDirectory ( ) ) ; extendPluginClasspath ( classpathEntries ) ; Properties generatorProperties = new Properties ( ) ; if ( properties != null ) { for ( String key : properties . keySet ( ) ) { generatorProperties . setProperty ( key , properties . get ( key ) ) ; } } generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_SRC" , outletSrcOnceDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_RESOURCES" , outletResOnceDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_SRC" , outletSrcDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_RESOURCES" , outletResDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_WEBROOT" , outletWebrootDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_SRC_TEST" , outletSrcTestOnceDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_RESOURCES_TEST" , outletResTestOnceDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_SRC_TEST" , outletSrcTestDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_GEN_RESOURCES_TEST" , outletResTestDir . toString ( ) ) ; generatorProperties . setProperty ( OUTPUT_SLOT_PATH_PREFIX + "TO_DOC" , outletDocDir . toString ( ) ) ; List < File > generatedFiles = doRunGenerator ( generatorProperties ) ; if ( generatedFiles != null ) { if ( isVerbose ( ) ) { for ( File generatedFile : generatedFiles ) { getLog ( ) . info ( "Generated: " + getProjectRelativePath ( generatedFile ) ) ; } } updateStatusFile ( generatedFiles ) ; if ( generatedFiles . size ( ) > 0 ) { refreshEclipseWorkspace ( ) ; } getLog ( ) . info ( "Generated " + generatedFiles . size ( ) + " files" ) ; return true ; } else { getLog ( ) . error ( "Executing generator workflow failed" ) ; } return false ; }
Executes the commandline running the Eclipse MWE2 launcher and returns
the commandlines exit value.