diff --git a/dist/assembly.xml b/dist/assembly.xml
new file mode 100644
index 0000000000..4c892d194b
--- /dev/null
+++ b/dist/assembly.xml
@@ -0,0 +1,50 @@
+
+
+ distro
+
+
+ zip
+ tar.gz
+
+
+ false
+
+
+
+ ${build.target.dir}
+ keycloak-${project.version}
+
+ **/*.sh
+ domain/tmp/auth
+ domain/tmp/auth
+ **/*-users.properties
+
+
+
+ ${build.target.dir}
+ keycloak-${project.version}
+
+ **/*.sh
+
+ 0755
+
+
+ ${build.target.dir}
+ keycloak-${project.version}
+
+ **/*-users.properties
+
+ 0600
+
+
+ ${build.target.dir}
+ keycloak-${project.version}
+
+ domain/tmp/auth
+ standalone/tmp/auth
+
+ 0700
+
+
+
+
diff --git a/dist/build.xml b/dist/build.xml
new file mode 100644
index 0000000000..c9bfd9589c
--- /dev/null
+++ b/dist/build.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/pom.xml b/dist/pom.xml
new file mode 100644
index 0000000000..ef0ff991b3
--- /dev/null
+++ b/dist/pom.xml
@@ -0,0 +1,96 @@
+
+
+ 4.0.0
+
+
+ org.keycloak
+ keycloak-parent
+ 1.0-alpha-1
+
+
+ keycloak-dist
+ Keycloak Dist
+ pom
+
+
+ ${project.build.directory}/keycloak-${project.version}
+
+
+
+
+ release
+
+
+ release
+ true
+
+
+
+
+
+ org.keycloak
+ keycloak-server
+ 1.0-alpha-1
+ war
+
+
+ org.jboss.as
+ jboss-as-dist
+ ${jboss.version}
+ zip
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 1.7
+
+
+ build
+ compile
+
+
+
+
+
+
+
+
+ run
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ assemble
+ package
+
+ single
+
+
+
+ assembly.xml
+
+ keycloak-${project.version}
+ false
+ target/
+ target/assembly/work
+ gnu
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index da29152c6a..c050cc9959 100755
--- a/pom.xml
+++ b/pom.xml
@@ -20,6 +20,7 @@
1.6.1
5.1.25
1.6.1
+ 7.1.1.Final
http://keycloak.org
@@ -72,7 +73,8 @@
admin-ui
examples
testsuite
-
+ server
+ dist
diff --git a/server/pom.xml b/server/pom.xml
new file mode 100755
index 0000000000..51b450c6d6
--- /dev/null
+++ b/server/pom.xml
@@ -0,0 +1,149 @@
+
+
+
+ keycloak-parent
+ org.keycloak
+ 1.0-alpha-1
+
+
+ 4.0.0
+ org.keycloak
+ keycloak-server
+ war
+ Keycloak Server
+
+
+
+
+ org.jboss.resteasy
+ jose-jwt
+ provided
+
+
+ org.keycloak
+ keycloak-admin-ui
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-admin-ui-styles
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-core
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-services
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-model-api
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-model-picketlink
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-model-jpa
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-social-core
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-social-google
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-social-twitter
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-social-facebook
+ ${project.version}
+
+
+ org.keycloak
+ keycloak-forms
+ ${project.version}
+
+
+ org.picketlink
+ picketlink-idm-api
+
+
+ org.picketlink
+ picketlink-idm-impl
+
+
+ org.picketlink
+ picketlink-idm-simple-schema
+
+
+ org.picketlink
+ picketlink-config
+
+
+ org.jboss.resteasy
+ resteasy-jaxrs
+ provided
+
+
+ log4j
+ log4j
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.slf4j
+ slf4j-simple
+
+
+
+
+ org.jboss.resteasy
+ jaxrs-api
+ provided
+
+
+ com.h2database
+ h2
+ 1.3.161
+
+
+ junit
+ junit
+ 4.1
+ test
+
+
+
+
+ auth-server
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.6
+
+
+
+
+
diff --git a/server/src/main/java/org/keycloak/server/KeycloakServerApplication.java b/server/src/main/java/org/keycloak/server/KeycloakServerApplication.java
new file mode 100755
index 0000000000..cb91e735fe
--- /dev/null
+++ b/server/src/main/java/org/keycloak/server/KeycloakServerApplication.java
@@ -0,0 +1,28 @@
+package org.keycloak.server;
+
+import org.jboss.resteasy.jwt.JsonSerialization;
+import org.keycloak.representations.idm.RealmRepresentation;
+import org.keycloak.services.managers.ApplianceBootstrap;
+import org.keycloak.services.managers.RealmManager;
+import org.keycloak.models.KeycloakSession;
+import org.keycloak.models.RealmModel;
+import org.keycloak.services.resources.KeycloakApplication;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.core.Context;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class KeycloakServerApplication extends KeycloakApplication {
+
+ public KeycloakServerApplication(@Context ServletContext servletContext) {
+ super(servletContext);
+ KeycloakSession session = factory.createSession();
+ session.getTransaction().begin();
+ ApplianceBootstrap bootstrap = new ApplianceBootstrap();
+ bootstrap.bootstrap(session);
+ session.getTransaction().commit();
+ }
+
+}
diff --git a/server/src/main/resources/META-INF/persistence.xml b/server/src/main/resources/META-INF/persistence.xml
new file mode 100755
index 0000000000..5d5eed0d7e
--- /dev/null
+++ b/server/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,33 @@
+
+
+ java:jboss/datasources/ExampleDS
+
+ org.picketlink.idm.jpa.model.sample.simple.AttributedTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.AccountTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.RoleTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.GroupTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.IdentityTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.RelationshipTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.RelationshipIdentityTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.PartitionTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.PasswordCredentialTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.DigestCredentialTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.X509CredentialTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.OTPCredentialTypeEntity
+ org.picketlink.idm.jpa.model.sample.simple.AttributeTypeEntity
+ org.keycloak.models.picketlink.mappings.RealmEntity
+ org.keycloak.models.picketlink.mappings.ApplicationEntity
+
+ true
+
+
+
+
+
+
+
+
+
diff --git a/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
new file mode 100755
index 0000000000..8caa96f6a0
--- /dev/null
+++ b/server/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/src/main/webapp/WEB-INF/web.xml b/server/src/main/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000000..08bf314196
--- /dev/null
+++ b/server/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,39 @@
+
+
+
+ auth-server
+
+
+ Resteasy
+ org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher
+
+ javax.ws.rs.Application
+ org.keycloak.server.KeycloakServerApplication
+
+
+ resteasy.servlet.mapping.prefix
+ /rest
+
+ 1
+ true
+
+
+
+ Keycloak Session Management
+ org.keycloak.services.filters.KeycloakSessionServletFilter
+
+
+
+ Keycloak Session Management
+ /rest/*
+
+
+
+ Resteasy
+ /rest/*
+
+
+