« prev index next »

7. Delete Generated Files

Principle

Celerio tracks all the files it generates. For this purpose Celerio creates and maintains the file .celerio/generated.xml. Do not edit or delete this file!

You can delete the generated files using the cleanGenerated goal of the `celerio-maven-plugin.

By default, all generated files that have not been modified manually are deleted. You may configure this plugin to exclude certain files so they do not get deleted.

Plugin details

Full name

This goal uses the file .celerio/generated.xml which is created by the celerio-maven-plugin:generate goal.

Attributes

excludedFiles

Use case: Celerio generates a file, you do not modify it manually, you commit it in your SCM. To prevent Celerio from deleting it, you add it to the excludedFiles list.

example:

<configuration>
  <excludedFiles>
    <param>src/main/generated-java/**/domain/**/*.java</param>
  </excludedFiles>
</configuration>

skip

Simple Usage

In your pom.xml create a dedicated profile to execute the plugin, then run:

mvn -PcleanGen clean

Here is the cleanGen profile detail:

	<profile>
		<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
		<!-- Delete code generated by Celerio -->
		<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
		<id>cleanGen</id>
		<build>
			<plugins>
				<plugin>
					<groupId>com.jaxio.celerio</groupId>
					<artifactId>celerio-maven-plugin</artifactId>
					<version>${dollar}{celerio-maven-plugin.version}</version>
					<executions>
						<execution>
							<id>Delete previously generated files (use .celerio/ folder)</id>
                            <!-- If you do not want certain generated files to be deleted, you can exclude them, for example: -->
                            <!--
                            <configuration>
                                <excludedFiles>
                                    <param>src/main/generated-java/**/domain/**/*.java</param>
                                </excludedFiles>
                            </configuration>
                            -->
							<goals>
								<goal>cleanGenerated</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
		<repositories>
			<repository>
				<id>jaxio-repository</id>
				<url>http://maven.jaxio.com/repository</url>
			</repository>
		</repositories>
		<pluginRepositories>
			<pluginRepository>
				<id>jaxio-repository</id>
				<url>http://maven.jaxio.com/repository</url>
			</pluginRepository>
		</pluginRepositories>
	</profile>

© 2005-2015 Jaxio | @jaxiosoft | Legal