Monday, August 11, 2008
Maven Jetty plugin and security realms
I often use the Jetty plugin for Maven; it's a super way to speed up development.
I'm currently in the process of creating a new web application which will need some basic security. For completeness I wanted to add a security user realm to my jetty configuration.
I initially added the realm in Jetty configuration, per the Jetty manual instructions.
My realm.properties where being loaded, the Jetty configuration was also without error, but when the Jetty container fired up I get an unknown realm warning.
Much wailing and nashing of teeth later I moved the user realm to the pom plugin definition and all is good. Why it didn't work using the configuration file is still a mystery.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<contextPath>/bmbo</contextPath>
<userRealms>
<userRealm implementation="org.mortbay.jetty.security.HashUserRealm">
<name>Bonus Manager Realm</name>
<config>
src/test/resources/jetty-realm.properties
</config>
</userRealm>
</userRealms>
</configuration>
</plugin>
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment