Add named parameters to allow adding of ConnectionDriverName and
ConnectionProperties
-------------------------------------------------------------------------------------
Key: MOPENJPA-20
URL: http://jira.codehaus.org/browse/MOPENJPA-20
Project: Maven 2.x OpenJPA Plugin
Issue Type: Improvement
Affects Versions: 1.0
Reporter: Mark Struberg
Assignee: Mark Struberg
Fix For: 1.1
If the persistence.xml doesn't contain the right database settings/credentials
(or none at all), a user can use this settings to define the database settings
which should get used for building e.g. the schema-delta.
A sample plugin section looks like that:
{verbatim}
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>1.1-SNAPSHOT</version>
<configuration>
<includes>
${jpa-includes}
</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<sqlAction>refresh</sqlAction>
<sqlFile>${project.build.directory}/database.sql</sqlFile>
<connectionDriverName>com.mchange.v2.c3p0.ComboPooledDataSource</connectionDriverName>
<connectionProperties>
driverClass=com.mysql.jdbc.Driver,
jdbcUrl=jdbc:mysql://localhost/exampleDatabase,
user=root,
password=,
minPoolSize=5,
acquireRetryAttempts=3,
maxPoolSize=20
</connectionProperties>
</configuration>
<executions>
<execution>
<id>mappingtool</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-all</artifactId>
<version>${openjpa.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
{verbatim}
This will override any connection settings to the test database defined in
persistence.xml.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email