keycloak-developers

Details

diff --git a/distribution/adapters/js-adapter-npm-zip/assembly.xml b/distribution/adapters/js-adapter-npm-zip/assembly.xml
new file mode 100755
index 0000000..5859d08
--- /dev/null
+++ b/distribution/adapters/js-adapter-npm-zip/assembly.xml
@@ -0,0 +1,50 @@
+<!--
+  ~ Copyright 2016 Red Hat, Inc. and/or its affiliates
+  ~ and other contributors as indicated by the @author tags.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<assembly>
+    <id>war-dist</id>
+
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>true</includeBaseDirectory>
+
+    <files>
+        <file>
+            <source>src/main/resources/bower.json</source>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+        </file>
+        <file>
+            <source>src/main/resources/package.json</source>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+        </file>
+    </files>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.build.directory}/unpacked/js-adapter</directory>
+            <outputDirectory>dist/</outputDirectory>
+            <includes>
+                <include>**/*.js</include>
+                <include>**/*.map</include>
+                <include>**/*.d.ts</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/distribution/adapters/js-adapter-npm-zip/pom.xml b/distribution/adapters/js-adapter-npm-zip/pom.xml
new file mode 100755
index 0000000..16dff44
--- /dev/null
+++ b/distribution/adapters/js-adapter-npm-zip/pom.xml
@@ -0,0 +1,103 @@
+<!--
+  ~ Copyright 2016 Red Hat, Inc. and/or its affiliates
+  ~ and other contributors as indicated by the @author tags.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<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>
+    <parent>
+        <artifactId>keycloak-parent</artifactId>
+        <groupId>org.keycloak</groupId>
+        <version>5.0.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>keycloak-js-adapter-npm-dist</artifactId>
+    <packaging>pom</packaging>
+    <name>Keycloak JS Adapter NPM Distribution</name>
+    <description/>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.keycloak</groupId>
+            <artifactId>keycloak-js-adapter</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <excludeTransitive>true</excludeTransitive>
+                            <includeGroupIds>org.keycloak</includeGroupIds>
+                            <includeArtifactIds>keycloak-js-adapter</includeArtifactIds>
+                            <outputDirectory>${project.build.directory}/unpacked/js-adapter</outputDirectory>
+                            <includes>*.js,*.map,*.d.ts</includes>
+                            <excludes>**/welcome-content/*</excludes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>assemble</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>assembly.xml</descriptor>
+                            </descriptors>
+                            <outputDirectory>
+                                target
+                            </outputDirectory>
+                            <workDirectory>
+                                target/assembly/work
+                            </workDirectory>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>product</id>
+            <activation>
+                <property>
+                    <name>product</name>
+                </property>
+            </activation>
+            <build>
+                <finalName>${product.name}-${product.filename.version}-js-adapter</finalName>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
diff --git a/distribution/adapters/js-adapter-npm-zip/src/main/resources/bower.json b/distribution/adapters/js-adapter-npm-zip/src/main/resources/bower.json
new file mode 100644
index 0000000..7657a09
--- /dev/null
+++ b/distribution/adapters/js-adapter-npm-zip/src/main/resources/bower.json
@@ -0,0 +1,17 @@
+{
+  "name": "keycloak",
+  "version": "${project.version}",
+  "main": "dist/keycloak.js",
+  "ignore": [
+    "**/.*"
+  ],
+  "description": "Keycloak adapter",
+  "keywords": [
+    "keycloak",
+    "sso",
+    "oauth",
+    "oauth2",
+    "authentication"
+  ],
+  "license": "Apache-2.0"
+}
diff --git a/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json b/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json
new file mode 100644
index 0000000..64b0838
--- /dev/null
+++ b/distribution/adapters/js-adapter-npm-zip/src/main/resources/package.json
@@ -0,0 +1,24 @@
+{
+  "name": "keycloak-js",
+  "version": "${project.version}",
+  "description": "Keycloak Adapter",
+  "main": "dist/keycloak.js",
+  "typings": "dist/keycloak.d.ts",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/keycloak/keycloak"
+  },
+  "author": "Keycloak",
+  "license": "Apache-2.0",
+  "homepage": "https://www.keycloak.org",
+  "keywords": [
+    "keycloak",
+    "sso",
+    "oauth",
+    "oauth2",
+    "authentication"
+  ]
+}
diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml
index 873b1b0..e8c53e3 100755
--- a/distribution/adapters/pom.xml
+++ b/distribution/adapters/pom.xml
@@ -57,6 +57,7 @@
                 <module>jetty93-adapter-zip</module>
                 <module>jetty94-adapter-zip</module>
                 <module>wf8-adapter</module>
+                <module>js-adapter-npm-zip</module>
             </modules>
         </profile>
     </profiles>