roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1039586 - in /roller/trunk: ./ planet-business/ planet-business/src/main/resources/META-INF/ weblogger-assembly/ weblogger-assembly/src/main/assembly/ weblogger-business/ weblogger-business/src/main/resources/META-INF/ weblogger-webapp/src...
Date Fri, 26 Nov 2010 23:04:00 GMT
Author: snoopdave
Date: Fri Nov 26 23:03:59 2010
New Revision: 1039586

URL: http://svn.apache.org/viewvc?rev=1039586&view=rev
Log:
For https://issues.apache.org/jira/browse/ROL-1894
Enable Roller 5 to run on JBoss AS 6

Changes to create different persistence.xml files for JBoss.

It's bad enough that you have to hard-code a JNDI name inside your persistence.xml, which
is inside a JAR and inside a WAR and not very easy for somebody to edit.

What's even worse is that you can't hard-code in a name that will work on all Java EE app
servers. If you create a datasource with the name 'jdbc/rollerdb' in the app server console,
Glassfish will want to see 'jdbc/rollerdb' in the persistence.xml and JBoss will want 'java:/rollerdb'

Added:
    roller/trunk/build-javaee-release.sh   (with props)
    roller/trunk/build-jboss-release.sh   (with props)
Removed:
    roller/trunk/build-javaee-releases.sh
Modified:
    roller/trunk/build-tomcat-release.sh
    roller/trunk/planet-business/pom.xml
    roller/trunk/planet-business/src/main/resources/META-INF/persistence.xml
    roller/trunk/weblogger-assembly/pom.xml
    roller/trunk/weblogger-assembly/src/main/assembly/for-javaee.xml
    roller/trunk/weblogger-assembly/src/main/assembly/for-jboss.xml
    roller/trunk/weblogger-business/pom.xml
    roller/trunk/weblogger-business/src/main/resources/META-INF/persistence.xml
    roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml
    roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/sun-web.xml

Added: roller/trunk/build-javaee-release.sh
URL: http://svn.apache.org/viewvc/roller/trunk/build-javaee-release.sh?rev=1039586&view=auto
==============================================================================
--- roller/trunk/build-javaee-release.sh (added)
+++ roller/trunk/build-javaee-release.sh Fri Nov 26 23:03:59 2010
@@ -0,0 +1,7 @@
+# How to build the Java EE release of Roller (Glassfish)
+mvn clean
+mvn -Djavaee=true install
+pushd weblogger-assembly
+mvn clean
+mvn -Djavaee=true install
+popd

Propchange: roller/trunk/build-javaee-release.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: roller/trunk/build-jboss-release.sh
URL: http://svn.apache.org/viewvc/roller/trunk/build-jboss-release.sh?rev=1039586&view=auto
==============================================================================
--- roller/trunk/build-jboss-release.sh (added)
+++ roller/trunk/build-jboss-release.sh Fri Nov 26 23:03:59 2010
@@ -0,0 +1,7 @@
+# How to build the JBoss release of Roller
+mvn clean
+mvn -Djavaee=true -Djboss=true install
+pushd weblogger-assembly
+mvn clean
+mvn -Djboss=true install
+popd

Propchange: roller/trunk/build-jboss-release.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: roller/trunk/build-tomcat-release.sh
URL: http://svn.apache.org/viewvc/roller/trunk/build-tomcat-release.sh?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/build-tomcat-release.sh (original)
+++ roller/trunk/build-tomcat-release.sh Fri Nov 26 23:03:59 2010
@@ -1,6 +1,8 @@
+# How to build a Tomcat release of Roller
 mvn clean
 mvn install
 pushd weblogger-assembly
+mvn clean
 mvn install
 popd
 

Modified: roller/trunk/planet-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/pom.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/planet-business/pom.xml (original)
+++ roller/trunk/planet-business/pom.xml Fri Nov 26 23:03:59 2010
@@ -351,6 +351,29 @@
     </build>
 
     <profiles>
+
+        <profile>
+            <id>jboss</id>
+            <!-- building for JBoss, turn on 'java:/' prefix on datasource JNDI name -->
+            <activation>
+                <property><name>jboss</name></property>
+            </activation> 
+            <properties>
+                <datasourceName>java:/jdbc/rollerdb</datasourceName>
+            </properties>
+        </profile>
+
+        <profile>
+            <id>notjboss</id>
+            <!-- not building for JBoss, don't use 'java:/' prefix on datasource JNDI
name -->
+            <activation>
+                <property><name>!jboss</name></property>
+            </activation> 
+            <properties>
+                <datasourceName>jdbc/rollerdb</datasourceName>
+            </properties>
+        </profile>
+        
         <profile>
             <id>openjpa</id>
             <!-- to turn off OpenJPA bytecode enhancement define property '-Djavaee=true'
-->

Modified: roller/trunk/planet-business/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/main/resources/META-INF/persistence.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/planet-business/src/main/resources/META-INF/persistence.xml (original)
+++ roller/trunk/planet-business/src/main/resources/META-INF/persistence.xml Fri Nov 26 23:03:59
2010
@@ -1,6 +1,6 @@
 <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
     <persistence-unit name ="PlanetPU" transaction-type = "RESOURCE_LOCAL"> 
-        <non-jta-data-source>java:/RollerDS</non-jta-data-source>
+        <non-jta-data-source>${datasourceName}</non-jta-data-source>
         <mapping-file>org/apache/roller/planet/pojos/RuntimeConfigProperty.orm.xml</mapping-file>
         <mapping-file>org/apache/roller/planet/pojos/Planet.orm.xml</mapping-file>
         <mapping-file>org/apache/roller/planet/pojos/PlanetGroup.orm.xml</mapping-file>

Modified: roller/trunk/weblogger-assembly/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-assembly/pom.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-assembly/pom.xml (original)
+++ roller/trunk/weblogger-assembly/pom.xml Fri Nov 26 23:03:59 2010
@@ -98,6 +98,29 @@
                         <configuration>
                             <descriptors>
                                 <descriptor>src/main/assembly/for-javaee.xml</descriptor>
+                                <descriptor>src/main/assembly/source.xml</descriptor>
+                            </descriptors>
+                            <tarLongFileMode>gnu</tarLongFileMode>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        
+        <profile>
+            <id>jboss-assembly</id>
+            <activation>
+                <property>
+                    <name>jboss</name>
+                </property>
+            </activation> 
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <configuration>
+                            <descriptors>
                                 <descriptor>src/main/assembly/for-jboss.xml</descriptor>
                                 <descriptor>src/main/assembly/source.xml</descriptor>
                             </descriptors>

Modified: roller/trunk/weblogger-assembly/src/main/assembly/for-javaee.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-assembly/src/main/assembly/for-javaee.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-assembly/src/main/assembly/for-javaee.xml (original)
+++ roller/trunk/weblogger-assembly/src/main/assembly/for-javaee.xml Fri Nov 26 23:03:59 2010
@@ -35,13 +35,12 @@
     <fileSets>
         <fileSet>
             <outputDirectory>
-            ${artifact.artifactId}-${artifact.version}/webapp/roller
+            ${artifact.artifactId}-${artifact.version}-javaee/webapp/roller
             </outputDirectory>
             <directory>../weblogger-webapp/target/roller</directory>
             <excludes>
                 <!-- don't include all those Jave EE jars that Tomcat needs -->
                 <exclude>**/openjpa**</exclude>
-                <exclude>**/xercesImpl**</exclude>
                 <exclude>**/geronimo**</exclude>
             </excludes>
         </fileSet>
@@ -50,27 +49,27 @@
     <files> 
         <file> 
             <source>../README.txt</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee</outputDirectory>
         </file> 
         <file> 
             <source>../NOTICE.txt</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee</outputDirectory>
         </file> 
         <file> 
             <source>../LICENSE.txt</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee</outputDirectory>
         </file> 
         <file> 
             <source>../weblogger-docs/installguide/generated/roller-install-guide.pdf</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}/docs</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee/docs</outputDirectory>
         </file> 
         <file> 
             <source>../weblogger-docs/userguide/generated/roller-user-guide.pdf</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}/docs</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee/docs</outputDirectory>
         </file> 
         <file> 
             <source>../weblogger-docs/templateguide/generated/roller-template-guide.pdf</source>
-            <outputDirectory>${artifact.artifactId}-${artifact.version}/docs</outputDirectory>
+            <outputDirectory>${artifact.artifactId}-${artifact.version}-javaee/docs</outputDirectory>
         </file> 
     </files>
 

Modified: roller/trunk/weblogger-assembly/src/main/assembly/for-jboss.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-assembly/src/main/assembly/for-jboss.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-assembly/src/main/assembly/for-jboss.xml (original)
+++ roller/trunk/weblogger-assembly/src/main/assembly/for-jboss.xml Fri Nov 26 23:03:59 2010
@@ -35,7 +35,7 @@
     <fileSets>
         <fileSet>
             <outputDirectory>
-            ${artifact.artifactId}-${artifact.version}/webapp/roller
+            ${artifact.artifactId}-${artifact.version}-jboss/webapp/roller
             </outputDirectory>
             <directory>../weblogger-webapp/target/roller</directory>
             <excludes>

Modified: roller/trunk/weblogger-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/pom.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-business/pom.xml (original)
+++ roller/trunk/weblogger-business/pom.xml Fri Nov 26 23:03:59 2010
@@ -396,7 +396,19 @@
                 <directory>${project.basedir}/src/main/resources</directory>
                 <filtering>false</filtering>
                 <includes>
-                    <include>**/**</include>
+                    <include>org/**</include>
+                </includes>
+                <excludes>
+                    <exclude>**/sql/**</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <!-- ensure version and persistence files get substitions -->
+                <directory>${project.basedir}/src/main/resources</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>roller-version.properties</include>
+                    <include>META-INF/**</include>
                 </includes>
             </resource>
         </resources>
@@ -404,6 +416,29 @@
     </build>
 
     <profiles>
+        
+        <profile>
+            <id>jboss</id>
+            <!-- building for JBoss, turn on 'java:/' prefix on datasource JNDI name -->
+            <activation>
+                <property><name>jboss</name></property>
+            </activation> 
+            <properties>
+                <datasourceName>java:/jdbc/rollerdb</datasourceName>
+            </properties>
+        </profile>
+
+        <profile>
+            <id>notjboss</id>
+            <!-- not building for JBoss, don't use 'java:/' prefix on datasource JNDI
name -->
+            <activation>
+                <property><name>!jboss</name></property>
+            </activation> 
+            <properties>
+                <datasourceName>jdbc/rollerdb</datasourceName>
+            </properties>
+        </profile>
+
         <profile>
             <id>openjpa</id>
             <!-- to turn off OpenJPA bytecode enhancement define property '-Djavaee=true'
-->

Modified: roller/trunk/weblogger-business/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/resources/META-INF/persistence.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/resources/META-INF/persistence.xml (original)
+++ roller/trunk/weblogger-business/src/main/resources/META-INF/persistence.xml Fri Nov 26
23:03:59 2010
@@ -1,6 +1,6 @@
 <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
     <persistence-unit name ="RollerPU" transaction-type="RESOURCE_LOCAL"> 
-        <non-jta-data-source>java:/RollerDS</non-jta-data-source>
+        <non-jta-data-source>${datasourceName}</non-jta-data-source>
         <mapping-file>org/apache/roller/weblogger/pojos/WeblogBookmark.orm.xml    
     </mapping-file>
         <mapping-file>org/apache/roller/weblogger/pojos/WeblogEntryComment.orm.xml
     </mapping-file>
         <mapping-file>org/apache/roller/weblogger/pojos/WeblogEntryAttribute.orm.xml
   </mapping-file>

Modified: roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml (original)
+++ roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml Fri Nov 26 23:03:59
2010
@@ -4,6 +4,6 @@
 <jboss-web>
    <resource-ref>
         <res-ref-name>jdbc/rollerdb</res-ref-name>
-        <jndi-name>java:/RollerDS</jndi-name>
+        <jndi-name>java:/jdbc/rollerdb</jndi-name>
    </resource-ref>
 </jboss-web>

Modified: roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/sun-web.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/sun-web.xml?rev=1039586&r1=1039585&r2=1039586&view=diff
==============================================================================
--- roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/sun-web.xml (original)
+++ roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/sun-web.xml Fri Nov 26 23:03:59
2010
@@ -1,22 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet
2.4//EN' 'http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd'>
-
-<sun-web-app>
-    
-    <session-config>
-        <session-manager>
+<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet
2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
+<sun-web-app error-url="">
+  <context-root>/</context-root>
+  <session-config>
+    <session-manager persistence-type="memory">
         </session-manager>
-    </session-config>
-
-    <resource-ref>
-        <res-ref-name>jdbc/rollerdb</res-ref-name>
-        <jndi-name>jdbc/rollerdb</jndi-name>
-    </resource-ref>
-    
-    <resource-ref>
-        <res-ref-name>mail/Session</res-ref-name>
-        <jndi-name>mail/Session</jndi-name>
-    </resource-ref>
-
+  </session-config>
+  <resource-ref>
+    <res-ref-name>jdbc/rollerdb</res-ref-name>
+    <jndi-name>jdbc/rollerdb</jndi-name>
+  </resource-ref>
+  <resource-ref>
+    <res-ref-name>mail/Session</res-ref-name>
+    <jndi-name>mail/Session</jndi-name>
+  </resource-ref>
 </sun-web-app>



Mime
View raw message