Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<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">
	<parent>
		<groupId>io.hawt</groupId>
		<artifactId>project</artifactId>
		<version>2.0.0</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<artifactId>hawtio-springboot</artifactId>
	<name>${project.artifactId}</name>
	<description>hawtio :: hawtio-springboot</description>

	<properties>
	</properties>

	<dependencies>

		<dependency>
			<artifactId>hawtio-web</artifactId>
			<groupId>io.hawt</groupId>
			<type>war</type>
			<scope>provided</scope>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<artifactId>hawtio-core</artifactId>
			<groupId>io.hawt</groupId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.hawt</groupId>
			<artifactId>hawtio-plugin-mbean</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<version>${spring-boot-version}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${jackson-version}</version>
		</dependency>

	</dependencies>
	<build>
		<plugins>
			<!-- 
			Repackage static content from war into a jar, placing static content under /static/hawtio
			 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>repackage</id>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<phase>prepare-package</phase>
						<configuration>
							<outputDirectory>${project.build.directory}/classes/static/hawtio/</outputDirectory>
							<includeArtifactIds>hawtio-web</includeArtifactIds>
							<excludeTypes>pom</excludeTypes>
							<excludes>**/WEB-INF/**,**/META-INF/**</excludes>
							<excludeTransitive>true</excludeTransitive>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- 
			angularJs html5mode makes things difficult, as it requires a server side redirect to be configured, and relying on a 404 redirect is also problematic
			so removing this feature
			 -->
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.3</version>
				<configuration>
					<basedir>${basedir}/target/classes/static/hawtio</basedir>
				</configuration>
				<executions>
					<execution>
						<id>removeBaseRewriteStatement</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<includes>
								<include>index.html</include>
							</includes>
							<encoding>ISO-8859-1</encoding>
							<token>document.write("&lt;base href='/" + base + "/' /&gt;");</token>
							<value>//document.write("&lt;base href='/" + base + "/' /&gt;");</value>
							<regex>false</regex>
							<quiet>false</quiet>
						</configuration>
					</execution>
					<execution>
						<id>removeHtml5Mode</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<includes>
								<include>app/app.js</include>
							</includes>
							<encoding>ISO-8859-1</encoding>
							<token>$locationProvider.html5Mode(true);</token>
							<value>$locationProvider.html5Mode(false);</value>
							<regex>false</regex>
							<quiet>false</quiet>
						</configuration>
					</execution>
				</executions>

			</plugin>
		</plugins>
	</build>
</project>
New to GrepCode? Check out our FAQ X