From 78d12c9b0a07399b14adc25a0ddf296eaf9f516e Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Wed, 7 Dec 2011 16:05:24 +0000 Subject: [PATCH] OPENJPA-2088 remove cyclic build dependencies By using just the parts of the openjpa dependencies we really need, we can get rid of cyclic build dependencies. I also added a help page which describes how to manually configure the openjpa-maven-plugin dependencies for using it with an older OpenJPA version. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1211489 13f79535-47bb-0310-9956-ffa450edef68 --- openjpa-tools/openjpa-maven-plugin/pom.xml | 7 ++ .../src/it/default_settings/pom.xml | 36 +++++++++- .../src/it/dependingArtifact/pom.xml | 28 ++++++++ .../src/it/dependingArtifact/prjB/pom.xml | 12 +++- .../src/it/nonDefaultPersistenceXml/pom.xml | 26 ++++++- .../src/it/testDependencies/pom.xml | 29 ++++++++ .../src/it/testDependencies/prjB/pom.xml | 12 +++- .../src/site/apt/examples/older_versions.apt | 68 +++++++++++++++++++ .../src/site/apt/usage.apt | 14 +--- 9 files changed, 217 insertions(+), 15 deletions(-) create mode 100644 openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/older_versions.apt diff --git a/openjpa-tools/openjpa-maven-plugin/pom.xml b/openjpa-tools/openjpa-maven-plugin/pom.xml index 5b39195c8..ab1710bef 100644 --- a/openjpa-tools/openjpa-maven-plugin/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/pom.xml @@ -100,6 +100,13 @@ openjpa-persistence ${project.version} + + + org.apache.openjpa + openjpa-persistence-jdbc + ${project.version} + + org.apache.geronimo.specs geronimo-jpa_2.0_spec diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/default_settings/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/default_settings/pom.xml index 129f75d09..6bf372657 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/default_settings/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/default_settings/pom.xml @@ -23,6 +23,13 @@ 4.0.0 + + + org.apache.openjpa + openjpa-tools + 2.2.0-SNAPSHOT + + org.apache.openjpa.tools.openjpa-maven-plugin.testing enhance 1.0-SNAPSHOT @@ -33,9 +40,29 @@ 3.8.2 + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + + + org.apache.geronimo.specs + geronimo-validation_1.0_spec + + + org.apache.openjpa - openjpa + openjpa-kernel + @pom.version@ + + + org.apache.openjpa + openjpa-jdbc + @pom.version@ + + + org.apache.openjpa + openjpa-persistence @pom.version@ @@ -47,6 +74,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + org.apache.openjpa openjpa-maven-plugin diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/pom.xml index 57f8538e8..608e97f6d 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/pom.xml @@ -24,6 +24,12 @@ 4.0.0 + + org.apache.openjpa + openjpa-tools + 2.2.0-SNAPSHOT + + org.apache.openjpa.tools.openjpa-maven-plugin.testing dependingProjects 1.0-SNAPSHOT @@ -35,12 +41,34 @@ + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + + + org.apache.geronimo.specs + geronimo-validation_1.0_spec + + junit junit 3.8.2 + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + prjA prjB diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/prjB/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/prjB/pom.xml index 0fb69e102..77065259c 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/prjB/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/dependingArtifact/prjB/pom.xml @@ -42,7 +42,17 @@ org.apache.openjpa - openjpa + openjpa-kernel + @pom.version@ + + + org.apache.openjpa + openjpa-jdbc + @pom.version@ + + + org.apache.openjpa + openjpa-persistence @pom.version@ diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/nonDefaultPersistenceXml/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/nonDefaultPersistenceXml/pom.xml index d538ef2e9..f456babf8 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/nonDefaultPersistenceXml/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/nonDefaultPersistenceXml/pom.xml @@ -23,10 +23,26 @@ 4.0.0 + + + org.apache.openjpa + openjpa-tools + 2.2.0-SNAPSHOT + + org.apache.openjpa.tools.openjpa-maven-plugin.testing nonDefaultPersistenceXml 1.0-SNAPSHOT + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + + + org.apache.geronimo.specs + geronimo-validation_1.0_spec + + junit junit @@ -35,7 +51,7 @@ org.apache.openjpa - openjpa + openjpa-kernel @pom.version@ @@ -47,6 +63,14 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + org.apache.openjpa openjpa-maven-plugin diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/pom.xml index 8c9f65ded..9cb7382b9 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/pom.xml @@ -16,6 +16,13 @@ --> 4.0.0 + + + org.apache.openjpa + openjpa-tools + 2.2.0-SNAPSHOT + + org.apache.openjpa.tools.openjpa-maven-plugin.testing testDependencies 1.0-SNAPSHOT @@ -27,12 +34,34 @@ + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + + + org.apache.geronimo.specs + geronimo-validation_1.0_spec + + junit junit 3.8.2 + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + prjA prjB diff --git a/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/prjB/pom.xml b/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/prjB/pom.xml index c45c773b2..2685c612e 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/prjB/pom.xml +++ b/openjpa-tools/openjpa-maven-plugin/src/it/testDependencies/prjB/pom.xml @@ -34,7 +34,17 @@ org.apache.openjpa - openjpa + openjpa-kernel + @pom.version@ + + + org.apache.openjpa + openjpa-jdbc + @pom.version@ + + + org.apache.openjpa + openjpa-persistence @pom.version@ diff --git a/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/older_versions.apt b/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/older_versions.apt new file mode 100644 index 000000000..7cf150109 --- /dev/null +++ b/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/older_versions.apt @@ -0,0 +1,68 @@ + ------ + Enhance + ------ + Mark Struberg + + ------ + Dezember, 7th, 2011 + ------ + +Running openjpa-maven-plugin with different OpenJPA verions + + The openjpa-maven-plugin by default uses OpenJPA with exactly the same version + as the plugin itself. If you like to use an older OpenJPA version (which doesn't + have an org.apache.openjpa:openjpa-maven-plugin), you can just override the + plugin dependencies + +------------------- + + [...] + + [...] + + + org.apache.openjpa + openjpa-maven-plugin + 2.2.0 + + + enhancer + process-classes + + enhance + + + + + + + org.apache.openjpa + openjpa-kernel + ${oldopenjpa.version} + + + org.apache.openjpa + openjpa-jdbc + ${oldopenjpa.version} + + + org.apache.openjpa + openjpa-persistence + ${oldopenjpa.version} + + + + org.apache.openjpa + openjpa-persistence-jdbc + ${oldopenjpa.version} + + + + + [...] + + [...] + + [...] + +------------------- diff --git a/openjpa-tools/openjpa-maven-plugin/src/site/apt/usage.apt b/openjpa-tools/openjpa-maven-plugin/src/site/apt/usage.apt index 65d46e51b..58e222299 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/site/apt/usage.apt +++ b/openjpa-tools/openjpa-maven-plugin/src/site/apt/usage.apt @@ -70,20 +70,12 @@ OpenJPA Maven Plugin - - - org.apache.openjpa - openjpa - 2.0.1 - - - +-----------+ - * You have to explicitly specify an OpenJPA dependency in the dependencies section - of the plugin! This has been changed to make sure that the correct OpenJPA version is - used for compile time enhancement and other tasks. + * You don't have to explicitly specify an OpenJPA dependency in the dependencies section + of the plugin! Follow the following guide to use this plugin with {{{examples/older_versions.html}older OpenJPA versions}}. + * The <<>> mojo will automatically be called in the <<>> phase.