Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>${groupId}</groupId>
	<artifactId>${artifactId}</artifactId>
	<version>${version}</version>
	<name>${module-name}</name>
	<packaging>war</packaging>
	<description>${module-description}</description>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<cruxVersion>5.2.0</cruxVersion>
		<webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory>
		<webinf.folder>${webappDirectory}/WEB-INF/</webinf.folder>
		<webinf.classes.folder>${webinf.folder}/classes/</webinf.classes.folder>
		<webappSourceDir>${basedir}/src/main/webapp</webappSourceDir>
		<xsd.dir>${basedir}/xsd</xsd.dir>
		<crawling.dir>${basedir}/crawling</crawling.dir>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.cruxframework</groupId>
			<artifactId>crux-dev</artifactId>
			<version>${cruxVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.cruxframework</groupId>
			<artifactId>crux-runtime</artifactId>
			<version>${cruxVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.cruxframework</groupId>
			<artifactId>crux-widgets</artifactId>
			<version>${cruxVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.cruxframework</groupId>
			<artifactId>crux-smart-faces</artifactId>
			<version>1.1.0</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!-- Compile -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<!-- Update webapp folders -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.4.3</version>
				<executions>
					<execution>
						<id>copy-web-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${webappDirectory}</outputDirectory>
							<resources>
								<resource>
									<directory>${webappSourceDir}</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-classes</id>
						<phase>process-classes</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${webinf.classes.folder}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.outputDirectory}</directory>
									<excludes>
										<exclude>**/*.crux.xml</exclude>
										<exclude>**/*.template.xml</exclude>
										<exclude>**/*.view.xml</exclude>
										<exclude>**/*.offline.xml</exclude>
										<exclude>**/*.xdevice.xml</exclude>
									</excludes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Generate the war -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>generate-war</id>
						<phase>package</phase>
						<goals>
							<goal>war</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<webappDirectory>${webappDirectory}</webappDirectory>
					<warSourceExcludes>WEB-INF/web.xml</warSourceExcludes>
					<packagingExcludes>
						**/gwt-dev*.jar,
						**/gwt-codeserver*.jar,
						**/gwt-user*.jar,
						**/validation-api*.jar,
						**/crux-dev*.jar,
						**/crux-widgets*.jar,
						**/crux-themes*.jar,
						**/*.view.xml,
						**/*.crux.xml,
						**/*.template.xml,
						**/*.offline.xml,
						**/*.xdevice.xml
					</packagingExcludes>
				</configuration>
			</plugin>
			<!-- Run Crux Compiler -->
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.6</version>
				<executions>
					<execution>
						<id>crux-compiler</id>
						<phase>prepare-package</phase>
						<configuration>
							<target>
								<taskdef resource="org/cruxframework/crux/tools/crux-tools.xml">
									<classpath>
										<path refid="maven.compile.classpath" />
									</classpath>
								</taskdef>

								<serviceMapper projectDir="${webappDirectory}">
									<classpath>
										<path refid="maven.compile.classpath" />
										<pathelement path="${webinf.classes.folder}" />
									</classpath>
								</serviceMapper>

								<cruxcompiler srcDir="${project.build.sourceDirectory}"
									keepPagesGeneratedFiles="true" outputDir="${webappDirectory}"
									webDir="${webappDirectory}" pagesOutputDir="${webappDirectory}"
									outputCharset="UTF-8" doNotPreCompileJavaSource="true"
									pageFileExtension="html">
									<classpath>
										<path refid="maven.compile.classpath" />
									</classpath>

									<!-- change these two parameters if you need to modify memory settings -->
									<jvmarg value="-Xmx768M" />
									<jvmarg value="-Xms256M" />

									<arg value="-localWorkers" />
									<arg value="2" />

									<!-- use these parameters if you want to modify GWT output settings 
										<arg value="-style"/> <arg value="DETAILED"/> <arg value="-logLevel"/> <arg 
										value="DEBUG"/> -->
								</cruxcompiler>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<!-- Run Schema Generator -->
		<profile>
			<id>generate-schemas</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.6</version>
						<configuration>
							<target>
								<taskdef resource="org/cruxframework/crux/tools/crux-tools.xml">
									<classpath>
										<path refid="maven.compile.classpath" />
									</classpath>
								</taskdef>
								<generateSchemas outputDir="${xsd.dir}"
									inputCharset="UTF-8">
									<classpath>
										<path refid="maven.compile.classpath" />
										<pathelement location="${project.build.sourceDirectory}" />
									</classpath>
								</generateSchemas>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- Run Crawling Tool -->
		<profile>
			<id>run-crawling-tool</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.6</version>
						<configuration>
							<target>
								<echo message="Running CrawlingTool..." />

								<java classname="org.cruxframework.crux.tools.crawling.CrawlingTool"
									fork="true">
									<classpath>
										<path refid="maven.compile.classpath" />
										<pathelement location="${webinf.classes.folder}" />
									</classpath>
									<arg value="outputDir" />
									<arg value="${crawling.dir}" />

									<arg value="applicationBaseURL" />
									<arg value="${webappDirectory}" />

									<arg value="javascriptTime" />
									<arg value="2000" />

									<arg value="urls" />
									<arg value="${webappDirectory}/index.html" />

									<arg value="stopOnErrors" />
									<arg value="false" />

									<jvmarg value="-Xmx768M" />
									<jvmarg value="-Xms256M" />
								</java>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>	
New to GrepCode? Check out our FAQ X