Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
borderstylesolide
titlehudson-realm.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
	<environment>
		<moduleId>
			<groupId>console.realm</groupId>
			<artifactId>hudson-realm</artifactId>
			<version>1.0</version>
			<type>car</type>
		</moduleId>
		<dependencies>
			<dependency>
				<groupId>org.apache.geronimo.framework</groupId>
				<artifactId>j2ee-security</artifactId>
				<type>car</type>
			</dependency>
		</dependencies>
	</environment>
	<gbean name="hudson-realm"
		class="org.apache.geronimo.security.realm.GenericSecurityRealm"
		xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
		<attribute name="realmName">hudson-realm</attribute>
		<attribute name="global">false</attribute>
		<reference name="ServerInfo">
			<name>ServerInfo</name>
		</reference>
		<xml-reference name="LoginModuleConfiguration">
			<log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
				<log:login-module control-flag="REQUIRED"
					wrap-principals="false">
					<log:login-domain-name>hudson-realm</log:login-domain-name>
					<log:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule
					</log:login-module-class>
					<log:option name="usersURI">var/security/users.properties
					</log:option>
					<log:option name="groupsURI">var/security/groups.properties
					</log:option>
				</log:login-module>
			</log:login-config>
		</xml-reference>
	</gbean>
</module>

The plan filters out org.apache.commons.lang. package that comes with Apache Commons Lang 2.5 in Geronimo 3.0. As of Hudson 1.160, Apache Commons Lang 2.4 is required and is already included in the war file.

It appears that Hudson uses a customized version of Apache JEXL made specifically for itself, so filtering the package from the web classloader is required. Note that <hidden-classes/> tag is not supported in Geronimo 3.0 any more, you can use <import-package>!org.apache.commons.lang.</import-package> to keep org.apache.common.lang. package in Geronimo server repository from loading into the classloader.

Code Block
xml
xml
borderStylesolid
titlehudson-geronimo-plan.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
	  <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
		<moduleId>
			<groupId>net.java.dev.hudson</groupId>
			<artifactId>hudson</artifactId>
			<version>1.386</version>
			<type>war</type>
		</moduleId>
		<dependencies>
			<dependency>
				    <moduleId>
      <groupId>hudson</groupId>
      <artifactId>hudson</artifactId>
      <version>2.0.0</version>
      <type>war</type>
    </moduleId>
    <dependencies>
      <dependency>
        <groupId>org.apache.geronimo.framework</groupId>
				        <artifactId>j2ee-security</artifactId>
				        <type>car</type>
			      </dependency>
			<dependency>
				       <dependency>
        <groupId>console.realm</groupId>
				<artifactId>hudson-realm</artifactId>
				<version>1.0</version>
	<type>car</type>
			      </dependency>
		    </dependencies>
		<hidden-classes>
			
    <import-package>!org.apache.commons.*</import-package>
    <import-package>!com.thoughtworks.*</import-package>
    <import-package>!org.dom4j.*</import-package>
    <!--
    <hidden-classes>
      <filter>org.apache.commons.lang.</filter>
			      <filter>org.apache.commons.jexl.</filter>
		      <filter>com.thoughtworks.xstream.</filter> 
    </hidden-classes>
	
    -->
  </environment>

	  <context-root>/hudson</context-root>

	  <security-realm-name>hudson-realm</security-realm-name>
	  <security>
		    <default-principal realm-name="hudson-realm">
			      <principal name="anonymous"
				 class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" />
		    </default-principal>
		    <role-mappings>
			      <role role-name="admin">
				        <realm realm-name="hudson-realm">
					          <principal name="AdminGroup"
						 class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" />
				        </realm>
				        <principal name="system"
					 class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" />
			      </role>
		    </role-mappings>
	  </security>
</web-app>

The plan filters out org.apache.commons.lang. package that comes with Apache Commons Lang 2.5 in Geronimo 3.0. As of Hudson 2.0.0, Apache Commons Lang 2.4 is required and is already included in the war file.

Starting Geronimo

Run Geronimo with ./bin/geronimo.sh run -vv command.

No Format
bgColor#000000
borderStylesolid
jeffchi@jeffchi-laptop:~/Geronimo/3.0$ ./bin/startup
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
Using GERONIMO_OUT:    /home/jeffchi/Geronimo/3.0/var/log/geronimo.out

Geronimo started in background. PID: 13075

...

No Format
bgColor#000000
borderStylesolid
jeffchi@jeffchi-laptop:~/Geronimo/3.0
$ ./bin/deploy.sh -u system -p manager deploy hudson-realm.xml
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
    Deployed console.realm/hudson-realm/1.0/car @ /hudson

Deploying hudson.war

Download hudson.war from its releases web page.

You can deploy hudson.war from the web console of Geronimo, but there's another way to do the same - executing deploy command on from the command line interface.

No Format
bgColor#000000
borderStylesolid
jeffchi@jeffchi-laptop:~/Geronimo/3.0
$ ./bin/deploy.sh -u system -p manager deploy hudson.war hudson-geronimo-plan.xml
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
    Deployed hudson/hudson/12.0.3860/war @ /hudson
The Geronimo console shows deployment progress as follows:
No Format
bgColor#000000
borderStylesolid
.....

Running the webapp

Point the browser of your choice to http://localhost:8080/hudson. You should see hudson's welcome page.

Setting up a new Maven2 job in hudson works fine too.

Image Removed