KEYCLOAK-553 Added minified keycloak.js

This commit is contained in:
Stian Thorgersen 2014-07-09 12:23:29 +01:00
parent a3cca7424a
commit 7491b1c369
3 changed files with 43 additions and 9 deletions

View file

@ -17,15 +17,32 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugins>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<executions>
<execution>
<id>min-js</id>
<phase>compile</phase>
<configuration>
<charset>utf-8</charset>
<webappSourceDir>${basedir}/src/main/resources</webappSourceDir>
<jsSourceDir>.</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>keycloak.js</jsSourceFile>
</jsSourceFiles>
<webappTargetDir>${project.build.directory}/classes</webappTargetDir>
<jsTargetDir>.</jsTargetDir>
<jsFinalFile>keycloak.js</jsFinalFile>
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View file

@ -550,6 +550,11 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.2</version>
</plugin>
</plugins>
</pluginManagement>

View file

@ -31,4 +31,16 @@ public class JsResource {
}
}
@GET
@Path("/keycloak.min.js")
@Produces("text/javascript")
public Response getMinJs() {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("keycloak.min.js");
if (inputStream != null) {
return Response.ok(inputStream).build();
} else {
return Response.status(Response.Status.NOT_FOUND).build();
}
}
}