re-enabled the Quickstart executable. Updated the QuickStart wiki page
git-svn-id: https://svn.apache.org/repos/asf/incubator/jsecurity/trunk@762605 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/samples/quickstart/pom.xml b/samples/quickstart/pom.xml
index 19d7269..6375d13 100644
--- a/samples/quickstart/pom.xml
+++ b/samples/quickstart/pom.xml
@@ -31,8 +31,29 @@
<name>Apache Ki :: Samples :: Quick Start</name>
<packaging>jar</packaging>
- <dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <classpathScope>test</classpathScope>
+ <mainClass>Quickstart</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
<dependency>
<groupId>org.apache.ki</groupId>
<artifactId>ki-core</artifactId>
@@ -40,9 +61,8 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <scope>runtime</scope>
+ <scope>test</scope>
</dependency>
-
</dependencies>
</project>
diff --git a/samples/quickstart/src/main/java/Quickstart.java b/samples/quickstart/src/main/java/Quickstart.java
index 0423238..a8edf20 100644
--- a/samples/quickstart/src/main/java/Quickstart.java
+++ b/samples/quickstart/src/main/java/Quickstart.java
@@ -17,18 +17,14 @@
* under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.ki.SecurityUtils;
+import org.apache.ki.authc.*;
import org.apache.ki.mgt.DefaultSecurityManager;
+import org.apache.ki.realm.text.PropertiesRealm;
import org.apache.ki.session.Session;
import org.apache.ki.subject.Subject;
-
-import org.apache.ki.authc.AuthenticationException;
-import org.apache.ki.authc.IncorrectCredentialsException;
-import org.apache.ki.authc.LockedAccountException;
-import org.apache.ki.authc.UnknownAccountException;
-import org.apache.ki.authc.UsernamePasswordToken;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -47,6 +43,7 @@
//But, since this is a quickstart, we just want you to get a feel for how the Ki API looks, so this
//is sufficient to have a simple working example:
DefaultSecurityManager securityManager = new DefaultSecurityManager();
+ securityManager.setRealm(new PropertiesRealm());
//for this simple example quickstart, make the SecurityManager accessible across the JVM. Most
//applications wouldn't do this and instead rely on their container configuration or web.xml for webapps. That