OPENJPA-1712 Split creation of o-p-j-test-base.jar into its own build, as jar:test-jar doesn't allow creation of 2 tests.jar in the same module and maven can't get the dependency scope right if jar:jar is used to create the artifact.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@986552 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald Woods 2010-08-18 02:40:39 +00:00
parent 84320dacb1
commit 0082fa48cd
11 changed files with 126 additions and 247 deletions

View File

@ -94,20 +94,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>attach-tests</id>
<phase>verify</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- old way of using antrun to enhance classes
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -160,9 +160,8 @@
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<artifactId>openjpa-testsupport</artifactId>
<version>${project.version}</version>
<!-- <classifier>tests</classifier> -->
<type>test-jar</type>
<scope>test</scope>
</dependency>
@ -185,18 +184,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>

View File

@ -81,37 +81,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -120,34 +120,6 @@ openjpa.version=${project.version}</echo>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -750,58 +750,6 @@
</execution>
</executions>
</plugin>
<!--
Create a o-p-j-tests.jar so we can reuse some of the base
TestCase classes in other modules, like openjpa-integration.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>test-base-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>test-base</classifier>
<classesDirectory>${project.build.testOutputDirectory}</classesDirectory>
<includes>
<!-- Note: Including entities in this jar will
cause problems for any modules that need
to enhance their own entities.
-->
<include>**/org/apache/openjpa/persistence/test/*.class</include>
<include>META-INF/LICENSE*</include>
<include>META-INF/NOTICE*</include>
<include>META-INF/DISCLAIM*</include>
</includes>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -692,12 +692,10 @@
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<artifactId>openjpa-testsupport</artifactId>
<version>${project.version}</version>
<!-- <classifier>test-base</classifier> -->
<type>test-jar</type>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
@ -741,18 +739,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -59,37 +59,4 @@
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -126,34 +126,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

117
openjpa-testsupport/pom.xml Normal file
View File

@ -0,0 +1,117 @@
<?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.
-->
<!--
Please keep the project tag on one line to avoid confusing
the release plugin.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-testsupport</artifactId>
<packaging>jar</packaging>
<name>OpenJPA Test Support Jar</name>
<dependencies>
<!-- make sure we build after o-p-j -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!-- need a depend on o-p-j tests jar -->
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta-regexp</groupId>
<artifactId>jakarta-regexp</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!--
Manually build a subset jar of o-p-j-tests.jar
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>extract-jar</id>
<phase>test-compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<unjar overwrite="true" dest="${project.build.testOutputDirectory}">
<fileset dir="${basedir}/../openjpa-persistence-jdbc">
<include name="target/openjpa-persistence-jdbc-${project.version}-tests.jar" />
</fileset>
</unjar>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<includes>
<!-- Note: Including entities in this jar will
cause problems for any modules that need
to enhance their own entities.
-->
<include>org/apache/openjpa/persistence/test/*.class</include>
<include>META-INF/LICENSE*</include>
<include>META-INF/NOTICE*</include>
<include>META-INF/persistence.xml</include>
</includes>
</configuration>
</plugin>
<!-- Don't run any of the extracted tests here... -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -46,7 +46,12 @@
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId>
<version>${project.version}</version>
<!-- <classifier>test-base</classifier> -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-testsupport</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
@ -54,35 +59,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>attach-tests</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- new way of using openjpa-maven-plugin to enhance classes -->
<plugin>
<groupId>org.codehaus.mojo</groupId>

View File

@ -123,6 +123,7 @@
<module>openjpa-jdbc</module>
<module>openjpa-persistence</module>
<module>openjpa-persistence-jdbc</module>
<module>openjpa-testsupport</module>
<module>openjpa-persistence-locking</module>
<module>openjpa-xmlstore</module>
<module>openjpa-slice</module>