Author: gmazza
Date: Sat Jul 13 04:46:06 2013
New Revision: 1502743
URL: http://svn.apache.org/r1502743
Log:
Third issue of last week's proposals: removed DB connectivity info from
persistence.xml
Modified:
roller/trunk/app/pom.xml
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
roller/trunk/app/src/main/resources/META-INF/persistence.xml
roller/trunk/app/src/main/webapp/META-INF/context.xml-example
roller/trunk/assembly-release/src/main/assembly/for-javaee.xml
roller/trunk/assembly-release/src/main/assembly/for-jboss.xml
roller/trunk/assembly-release/src/main/assembly/for-tomcat.xml
roller/trunk/assembly-release/src/main/assembly/source.xml
roller/trunk/assembly-war/src/main/assembly/for-javaee.xml
roller/trunk/assembly-war/src/main/assembly/for-jboss.xml
roller/trunk/assembly-war/src/main/assembly/for-tomcat.xml
roller/trunk/build-tomcat-release.sh
Modified: roller/trunk/app/pom.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/app/pom.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/app/pom.xml (original)
+++ roller/trunk/app/pom.xml Sat Jul 13 04:46:06 2013
@@ -106,14 +106,7 @@
<!-- To run JUnit tests using EclipseLink JPA instead of OpenJPA:
1.) Uncomment this dependency and comment-out the adjacent hibernate
and OpenJPA ones
- 2.) Comment-out the OpenJPA "-javaagent" line in the Surefire plugin
- below and comment-out the OpenJPA profile in order to prevent
- the OpenJPA bytecode enhancement
- 3.) In src/main/resources/META-INF/persistence.xml, comment-out the
- <non-jta-data-source> element, as EclipseLink tries to do a
- JNDI connection instead of relying on the jdbc properties if
- the former is available.
- 4.) In src/test/resources/roller-custom.properties, uncomment any
+ 2.) In src/test/resources/roller-custom.properties, uncomment any
eclipselink.* properties (JPA stack logging, etc.) desired
As of 4 July 2013, no JUnit failures with EclipseLink 2.5.0
@@ -881,10 +874,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <!-- Ensure tests will run even if 'openjpa' profile not
active -->
<forkMode>once</forkMode>
-
<!--argLine>-javaagent:"${user.home}/.m2/repository/org/apache/openjpa/openjpa/${openjpa.version}/openjpa-${openjpa.version}.jar"</argLine-->
-
+
<systemProperties>
<property>
<name>context.realpath</name>
@@ -1057,32 +1048,10 @@
</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:/RollerDS</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>
+ <!-- building for Tomcat, so add OpenJPA bytecode enhancement -->
<profile>
<id>openjpa</id>
- <!-- building for Tomcat, so add OpenJPA bytecode enhancement -->
<activation>
<property>
<name>!javaee</name>
Modified:
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
URL:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
---
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
(original)
+++
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
Sat Jul 13 04:46:06 2013
@@ -120,7 +120,7 @@ public class DatabaseProvider {
// Else attempt to locate JNDI datasource
} else {
- String name = (getJndiName().indexOf(":") == -1 ? "java:comp/env/"
+ getJndiName() : getJndiName());
+ String name = getFullJndiName();
successMessage("-- Using JNDI datasource name: " + name);
try {
InitialContext ic = new InitialContext();
Modified:
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
URL:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
---
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
(original)
+++
roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
Sat Jul 13 04:46:06 2013
@@ -96,8 +96,7 @@ public class JPAPersistenceStrategy {
}
if (dbProvider.getType() ==
DatabaseProvider.ConfigurationType.JNDI_NAME) {
- emfProps.setProperty("javax.persistence.nonJtaDataSource",
dbProvider.getJndiName());
-
+ emfProps.setProperty("javax.persistence.nonJtaDataSource",
dbProvider.getFullJndiName());
} else {
emfProps.setProperty("javax.persistence.jdbc.driver",
dbProvider.getJdbcDriverClass());
emfProps.setProperty("javax.persistence.jdbc.url",
dbProvider.getJdbcConnectionURL());
Modified: roller/trunk/app/src/main/resources/META-INF/persistence.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/META-INF/persistence.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/META-INF/persistence.xml (original)
+++ roller/trunk/app/src/main/resources/META-INF/persistence.xml Sat Jul 13
04:46:06 2013
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="RollerPU" transaction-type="RESOURCE_LOCAL">
- <non-jta-data-source>${datasourceName}</non-jta-data-source>
+ <!-- DB configuration done in roller-custom.properties (see Install guide)
+ Avoiding DB configuration here to allow the same persistence.xml to
be used between
+ testing and prod (which have different DB configuration)
+ -->
<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/app/src/main/webapp/META-INF/context.xml-example
URL:
http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/META-INF/context.xml-example?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/META-INF/context.xml-example (original)
+++ roller/trunk/app/src/main/webapp/META-INF/context.xml-example Sat Jul 13
04:46:06 2013
@@ -4,8 +4,8 @@ Example Tomcat Context Configuration fil
Documented in Chapter 7.1-7.2 of Roller Installation Guide
If you'd like to use Tomcat provided datasource and/or mail sessions then:
- Uncomment the appropriate database / mail blocks below
-- Set database.connetionType=jndi property in roller-custom.properties
-- Set mail.connetionType=jndi property in roller-custom.properties
+- Set database.connectionType=jndi property in roller-custom.properties
+- Set mail.connectionType=jndi property in roller-custom.properties
- Set the correct values for the database and mail server
- Rename this file to context.xml and deploy Roller WAR to Tomcat.
-->
Modified: roller/trunk/assembly-release/src/main/assembly/for-javaee.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-release/src/main/assembly/for-javaee.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-release/src/main/assembly/for-javaee.xml (original)
+++ roller/trunk/assembly-release/src/main/assembly/for-javaee.xml Sat Jul 13
04:46:06 2013
@@ -31,7 +31,7 @@
<files>
<file>
-
<source>../assembly-war/target/roller-${artifact.version}-javaee.war</source>
+
<source>../assembly-war/target/roller-war-${artifact.version}-javaee.war</source>
<outputDirectory>${artifact.artifactId}-${artifact.version}-javaee/webapp</outputDirectory>
</file>
<file>
Modified: roller/trunk/assembly-release/src/main/assembly/for-jboss.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-release/src/main/assembly/for-jboss.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-release/src/main/assembly/for-jboss.xml (original)
+++ roller/trunk/assembly-release/src/main/assembly/for-jboss.xml Sat Jul 13
04:46:06 2013
@@ -31,7 +31,7 @@
<files>
<file>
-
<source>../assembly-war/target/roller-${artifact.version}-jboss.war</source>
+
<source>../assembly-war/target/roller-war-${artifact.version}-jboss.war</source>
<outputDirectory>${artifact.artifactId}-${artifact.version}-jboss/webapp</outputDirectory>
</file>
<file>
Modified: roller/trunk/assembly-release/src/main/assembly/for-tomcat.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-release/src/main/assembly/for-tomcat.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-release/src/main/assembly/for-tomcat.xml (original)
+++ roller/trunk/assembly-release/src/main/assembly/for-tomcat.xml Sat Jul 13
04:46:06 2013
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><!--
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -31,7 +32,7 @@
<files>
<file>
-
<source>../assembly-war/target/roller-${artifact.version}-tomcat.war</source>
+
<source>../assembly-war/target/roller-war-${artifact.version}-tomcat.war</source>
<outputDirectory>${artifact.artifactId}-${artifact.version}-tomcat/webapp</outputDirectory>
</file>
<file>
Modified: roller/trunk/assembly-release/src/main/assembly/source.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-release/src/main/assembly/source.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-release/src/main/assembly/source.xml (original)
+++ roller/trunk/assembly-release/src/main/assembly/source.xml Sat Jul 13
04:46:06 2013
@@ -1,14 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?><!-- * Licensed to the Apache Software
- Foundation (ASF) under one * or more contributor license agreements.
See
- the NOTICE file * distributed with this work for additional information
*
- regarding copyright ownership. The ASF licenses this file * to you
under
- the Apache License, Version 2.0 (the * "License"); you may not use this
file
- except in compliance * with the License. You may obtain a copy of the
License
- at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required
by
- applicable law or agreed to in writing, * software distributed under
the
- License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS
- OF ANY * KIND, either express or implied. See the License for the *
specific
- language governing permissions and limitations * under the License. -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
<assembly>
<id>source</id>
<formats>
Modified: roller/trunk/assembly-war/src/main/assembly/for-javaee.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-war/src/main/assembly/for-javaee.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-war/src/main/assembly/for-javaee.xml (original)
+++ roller/trunk/assembly-war/src/main/assembly/for-javaee.xml Sat Jul 13
04:46:06 2013
@@ -31,14 +31,14 @@
<fileSets>
<fileSet>
<outputDirectory></outputDirectory>
- <directory>../webapp/target/roller</directory>
+ <directory>../app/target/roller</directory>
<excludes>
<!-- don't include all those Jave EE jars that Tomcat needs -->
<exclude>**/openjpa**</exclude>
<exclude>**/geronimo**</exclude>
<!-- don't include Jetty config, needed for build time only -->
- <exclude>**/jetty-env**</exclude>
+ <exclude>**/jetty-env.xml</exclude>
</excludes>
</fileSet>
</fileSets>
Modified: roller/trunk/assembly-war/src/main/assembly/for-jboss.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-war/src/main/assembly/for-jboss.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-war/src/main/assembly/for-jboss.xml (original)
+++ roller/trunk/assembly-war/src/main/assembly/for-jboss.xml Sat Jul 13
04:46:06 2013
@@ -31,7 +31,7 @@
<fileSets>
<fileSet>
<outputDirectory></outputDirectory>
- <directory>../webapp/target/roller</directory>
+ <directory>../app/target/roller</directory>
<excludes>
<!-- don't include all those Jave EE jars that Tomcat needs -->
<exclude>**/openjpa**</exclude>
@@ -43,8 +43,7 @@
<exclude>**/xercesImpl**</exclude>
<!-- don't include Jetty config, needed for build time only -->
- <exclude>**/jetty-env**</exclude>
-
+ <exclude>**/jetty-env.xml</exclude>
</excludes>
</fileSet>
</fileSets>
Modified: roller/trunk/assembly-war/src/main/assembly/for-tomcat.xml
URL:
http://svn.apache.org/viewvc/roller/trunk/assembly-war/src/main/assembly/for-tomcat.xml?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/assembly-war/src/main/assembly/for-tomcat.xml (original)
+++ roller/trunk/assembly-war/src/main/assembly/for-tomcat.xml Sat Jul 13
04:46:06 2013
@@ -31,10 +31,10 @@
<fileSets>
<fileSet>
<outputDirectory></outputDirectory>
- <directory>../webapp/target/roller/</directory>
+ <directory>../app/target/roller/</directory>
<excludes>
<!-- don't include Jetty config, needed for build time only -->
- <exclude>**/jetty-env**</exclude>
+ <exclude>**/jetty-env.xml</exclude>
</excludes>
</fileSet>
</fileSets>
Modified: roller/trunk/build-tomcat-release.sh
URL:
http://svn.apache.org/viewvc/roller/trunk/build-tomcat-release.sh?rev=1502743&r1=1502742&r2=1502743&view=diff
==============================================================================
--- roller/trunk/build-tomcat-release.sh (original)
+++ roller/trunk/build-tomcat-release.sh Sat Jul 13 04:46:06 2013
@@ -1,5 +1,5 @@
# How to build a Tomcat release of Roller
-# See weblogger-war-assembly/src/main/assembly/*.xml for JAR diffs
+# See assembly-war/src/main/assembly/*.xml for JAR diffs
# between builds
mvn clean
mvn install