cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [1/3] cayenne git commit: CAY-2304
Date Wed, 11 Apr 2018 12:33:04 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master e1b6b6372 -> 17063b89f


CAY-2304

Add updating maven and gradle plugins class loaders with project dependencies to remove dependency duplication in configuration files.


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/c161a439
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/c161a439
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/c161a439

Branch: refs/heads/master
Commit: c161a439ddff9fc5c1897f79d20e8ca8affb5618
Parents: 67aad8a
Author: kkomyak <const1993@gmail.com>
Authored: Wed Apr 4 12:06:12 2018 +0300
Committer: kkomyak <const1993@gmail.com>
Committed: Thu Apr 5 17:34:49 2018 +0300

----------------------------------------------------------------------
 RELEASE-NOTES.txt                               |  1 +
 cayenne-gradle-plugin/build.gradle              |  6 ++
 .../apache/cayenne/tools/BaseCayenneTask.java   |  2 +
 .../org/apache/cayenne/tools/DbImportTask.java  | 36 ++++----
 .../tools/GradlePluginClassLoaderManager.java   | 90 ++++++++++++++++++++
 .../org/apache/cayenne/tools/DbImportIT.java    | 15 +++-
 .../org/apache/cayenne/tools/my-test.gradle     | 44 ++++++++++
 maven-plugins/cayenne-maven-plugin/pom.xml      |  4 +-
 .../apache/cayenne/tools/DbGeneratorMojo.java   | 17 +++-
 .../apache/cayenne/tools/DbImporterMojo.java    | 37 ++++----
 .../tools/MavenPluginClassLoaderManager.java    | 83 ++++++++++++++++++
 .../org/apache/cayenne/stubs/ArtifactStub.java  | 34 ++++++++
 .../cayenne/stubs/CayenneProjectStub.java       | 21 +++++
 .../cayenne/tools/DbImporterMojoTest.java       | 16 ++++
 .../testAddedFlattenedRelationship-pom.xml      |  5 ++
 .../dbimport/testComplexChangeOrder-pom.xml     |  6 ++
 .../testCustomObjectLayerSettings-pom.xml       |  6 ++
 .../dbimport/testDbAttributeChange-pom.xml      |  7 ++
 .../tools/dbimport/testDefaultPackage-pom.xml   |  6 ++
 .../dbimport/testExcludeRelationship-pom.xml    |  6 ++
 .../testExcludeRelationshipFirst-pom.xml        |  6 ++
 .../dbimport/testFilteringWithSchema-pom.xml    |  6 ++
 .../dbimport/testFkAttributeRename-pom.xml      |  6 ++
 ...tFlattensManyToManyWithRecursiveLink-pom.xml |  8 +-
 .../dbimport/testForceDataMapSchema-pom.xml     |  7 ++
 .../testImportAddTableAndColumn-pom.xml         |  8 +-
 .../tools/dbimport/testImportNewDataMap-pom.xml |  8 +-
 .../dbimport/testImportNewRelationship-pom.xml  |  6 ++
 .../dbimport/testImportWithoutChanges-pom.xml   |  6 ++
 .../tools/dbimport/testInheritance-pom.xml      |  6 ++
 .../tools/dbimport/testJava7Types-pom.xml       |  9 +-
 .../tools/dbimport/testJava8Types-pom.xml       |  6 ++
 .../cayenne/tools/dbimport/testOneToOne-pom.xml |  8 +-
 .../testPreserveCustomObjMappings-pom.xml       |  7 ++
 .../dbimport/testPreserveRelationships-pom.xml  |  8 +-
 .../dbimport/testSchemasAndTableExclude-pom.xml |  6 ++
 .../dbimport/testSkipPrimaryKeyLoading-pom.xml  |  8 +-
 .../testSkipRelationshipsLoading-pom.xml        |  8 +-
 ...SupportsCatalogsOnReverseEngineering-pom.xml |  6 ++
 .../tools/dbimport/testTableTypes-pom.xml       |  8 +-
 .../dbimport/testUnFlattensManyToMany-pom.xml   |  8 +-
 .../tools/dbimport/testViewsExclude-pom.xml     |  6 ++
 42 files changed, 545 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 3dfbdbc..1de0b7b 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -13,6 +13,7 @@ Date:
 ----------------------------------
 Changes/New Features:
 
+CAY-2304 Add updating maven and gradle plugins class loaders with project dependencies to remove dependency duplication in configuration files.
 CAY-2334 cgen: option to force run from maven/gradle
 CAY-2337 Save reverse engineering configuration with datamap XML
 CAY-2372 Extract new modules from cayenne-server

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/build.gradle
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/build.gradle b/cayenne-gradle-plugin/build.gradle
index f7058c7..04a31d9 100644
--- a/cayenne-gradle-plugin/build.gradle
+++ b/cayenne-gradle-plugin/build.gradle
@@ -27,6 +27,7 @@ version projectVersion
 def cayenneVersion = version
 
 apply plugin: 'java'
+apply plugin: 'maven'
 
 sourceCompatibility = 1.8
 
@@ -76,3 +77,8 @@ task licenseFiles(type: Copy) {
 
 processResources.dependsOn licenseFiles
 processResources.dependsOn versionFile
+
+test {
+    testLogging.showStandardStreams = true
+    testLogging.exceptionFormat = 'full'
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/BaseCayenneTask.java
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/BaseCayenneTask.java b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/BaseCayenneTask.java
index 1a28570..1d11f7c 100644
--- a/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/BaseCayenneTask.java
+++ b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/BaseCayenneTask.java
@@ -23,6 +23,7 @@ import java.io.File;
 
 import org.gradle.api.DefaultTask;
 import org.gradle.api.InvalidUserDataException;
+import org.gradle.api.Project;
 import org.gradle.api.tasks.Internal;
 
 /**
@@ -56,6 +57,7 @@ public class BaseCayenneTask extends DefaultTask {
         setMap(mapFile);
     }
 
+
     @Internal
     public File getDataMapFile() {
         if (map != null) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/DbImportTask.java
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/DbImportTask.java b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/DbImportTask.java
index d4e50a4..7a29cf9 100644
--- a/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/DbImportTask.java
+++ b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/DbImportTask.java
@@ -30,13 +30,12 @@ import org.apache.cayenne.dbsync.reverse.dbimport.DbImportConfigurationValidator
 import org.apache.cayenne.dbsync.reverse.dbimport.DbImportModule;
 import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
 import org.apache.cayenne.dbsync.reverse.filters.FiltersConfigBuilder;
+import org.apache.cayenne.di.ClassLoaderManager;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.tools.model.DataSourceConfig;
 import org.apache.cayenne.tools.model.DbImportConfig;
 import org.apache.cayenne.util.Util;
-import org.gradle.api.Task;
-import org.gradle.api.specs.Spec;
 import org.gradle.api.tasks.Input;
 import org.gradle.api.tasks.Internal;
 import org.gradle.api.tasks.Optional;
@@ -67,23 +66,19 @@ public class DbImportTask extends BaseCayenneTask {
 
     public DbImportTask() {
         // this task should be executed every invocation, so it is never up to date.
-        getOutputs().upToDateWhen(new Spec<Task>() {
-            @Override
-            public boolean isSatisfiedBy(Task task) {
-                return false;
-            }
-        });
+        getOutputs().upToDateWhen(task -> false);
     }
 
     @TaskAction
     public void runImport() {
         dataSource.validate();
 
-        DbImportConfiguration config = createConfig();
+        final DbImportConfiguration config = createConfig();
 
-        Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(getLogger()), new DbImportModule());
-        DbImportConfigurationValidator validator = new DbImportConfigurationValidator(reverseEngineering, config, injector);
+        final Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(getLogger()), new DbImportModule(),
+                binder -> binder.bind(ClassLoaderManager.class).toInstance(new GradlePluginClassLoaderManager(getProject())));
 
+        final DbImportConfigurationValidator validator = new DbImportConfigurationValidator(reverseEngineering, config, injector);
         try {
             validator.validate();
         } catch (Exception ex) {
@@ -93,7 +88,7 @@ public class DbImportTask extends BaseCayenneTask {
         try {
             injector.getInstance(DbImportAction.class).execute(config);
         } catch (Exception ex) {
-            Throwable th = Util.unwindException(ex);
+            final Throwable th = Util.unwindException(ex);
 
             String message = "Error importing database schema";
 
@@ -109,6 +104,7 @@ public class DbImportTask extends BaseCayenneTask {
     DbImportConfiguration createConfig() {
 
         reverseEngineering = config.toReverseEngineering();
+
         DbImportConfiguration config = new DbImportConfiguration();
         if (reverseEngineering.getCatalogs().size() == 0 && reverseEngineering.isEmptyContainer()) {
             config.setUseDataMapReverseEngineering(true);
@@ -142,15 +138,15 @@ public class DbImportTask extends BaseCayenneTask {
         return super.getDataMapFile();
     }
 
-    public void dbImport(Closure<?> closure) {
+    public void dbImport(final Closure<?> closure) {
         getProject().configure(config, closure);
     }
 
-    public void dbimport(Closure<?> closure) {
+    public void dbimport(final Closure<?> closure) {
         dbImport(closure);
     }
 
-    public void dataSource(Closure<?> closure) {
+    public void dataSource(final Closure<?> closure) {
         getProject().configure(dataSource, closure);
     }
 
@@ -166,11 +162,11 @@ public class DbImportTask extends BaseCayenneTask {
         return adapter;
     }
 
-    public void setAdapter(String adapter) {
+    public void setAdapter(final String adapter) {
         this.adapter = adapter;
     }
 
-    public void adapter(String adapter) {
+    public void adapter(final String adapter) {
         setAdapter(adapter);
     }
 
@@ -180,15 +176,15 @@ public class DbImportTask extends BaseCayenneTask {
         return cayenneProject;
     }
 
-    public void setCayenneProject(File cayenneProject) {
+    public void setCayenneProject(final File cayenneProject) {
         this.cayenneProject = cayenneProject;
     }
 
-    public void cayenneProject(File cayenneProject) {
+    public void cayenneProject(final File cayenneProject) {
         this.cayenneProject = cayenneProject;
     }
 
-    public void cayenneProject(String cayenneProjectFileName) {
+    public void cayenneProject(final String cayenneProjectFileName) {
         this.cayenneProject = getProject().file(cayenneProjectFileName);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/GradlePluginClassLoaderManager.java
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/GradlePluginClassLoaderManager.java b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/GradlePluginClassLoaderManager.java
new file mode 100644
index 0000000..898d0f1
--- /dev/null
+++ b/cayenne-gradle-plugin/src/main/java/org/apache/cayenne/tools/GradlePluginClassLoaderManager.java
@@ -0,0 +1,90 @@
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.di.ClassLoaderManager;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import org.gradle.api.Project;
+import org.gradle.api.artifacts.Configuration;
+import org.gradle.api.artifacts.ConfigurationContainer;
+import org.gradle.api.artifacts.Dependency;
+import org.gradle.api.artifacts.DependencySet;
+
+/**
+ * Gradle class loader manager to update class loader urls with project dependencies.
+ *
+ * @since 4.1
+ */
+public class GradlePluginClassLoaderManager implements ClassLoaderManager {
+
+    private Project project;
+    private List<URL> urls = new ArrayList<>();
+
+    public GradlePluginClassLoaderManager(final Project project) {
+        this.project = project;
+    }
+
+    @Override
+    public ClassLoader getClassLoader(final String resourceName) {
+        return buildClassLoader();
+    }
+
+    private void addUrlFromDependency(final Dependency dependency, final Configuration configuration) {
+
+        if(dependency == null) {
+            return;
+        }
+
+        configuration.files(dependency).forEach(file -> addUrlFromFile(file));
+    }
+
+    private void addUrlFromFile(final File file) {
+        try {
+            System.out.println("Add URI to classpath: " + file.toURI());
+            urls.add(file.toURI().toURL());
+        } catch (Exception ignored) {
+        }
+    }
+
+    private ClassLoader buildClassLoader() {
+        ClassLoader classLoader = getClass().getClassLoader();
+        ConfigurationContainer configurations = project.getConfigurations();
+
+        if (configurations == null || configurations.isEmpty()) {
+            return classLoader;
+        }
+
+        Configuration configuration = configurations.getByName("compile");
+        DependencySet dependencies = configuration.getDependencies();
+        if(dependencies == null || dependencies.isEmpty()) {
+            return classLoader;
+        }
+
+        dependencies.forEach(dependency -> addUrlFromDependency(dependency, configuration));
+
+        return new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/src/test/java/org/apache/cayenne/tools/DbImportIT.java
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/src/test/java/org/apache/cayenne/tools/DbImportIT.java b/cayenne-gradle-plugin/src/test/java/org/apache/cayenne/tools/DbImportIT.java
index 1fa16a7..e3bbf6c 100644
--- a/cayenne-gradle-plugin/src/test/java/org/apache/cayenne/tools/DbImportIT.java
+++ b/cayenne-gradle-plugin/src/test/java/org/apache/cayenne/tools/DbImportIT.java
@@ -20,7 +20,6 @@
 package org.apache.cayenne.tools;
 
 import java.io.File;
-import java.io.IOException;
 import java.net.URL;
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -70,6 +69,20 @@ public class DbImportIT extends BaseTaskIT {
     }
 
     @Test
+    public void emptyDbTaskWithDependency() throws Exception {
+        GradleRunner runner = createRunner("my-test", "cdbimport", "--info");
+
+        BuildResult result = runner.build();
+
+        assertNotNull(result.task(":cdbimport"));
+        assertEquals(TaskOutcome.SUCCESS, result.task(":cdbimport").getOutcome());
+        System.out.println(result.getOutput());
+        File dataMap = new File(projectDir.getAbsolutePath() + "/datamap.map.xml");
+        assertTrue(dataMap.exists());
+        assertTrue(result.getOutput().contains("Detected changes: No changes to import."));
+    }
+
+    @Test
     public void simpleDbTaskSuccess() throws Exception {
         String dbUrl = prepareDerbyDatabase("test_map_db");
         File dataMap = new File(projectDir.getAbsolutePath() + "/datamap.map.xml");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/cayenne-gradle-plugin/src/test/resources/org/apache/cayenne/tools/my-test.gradle
----------------------------------------------------------------------
diff --git a/cayenne-gradle-plugin/src/test/resources/org/apache/cayenne/tools/my-test.gradle b/cayenne-gradle-plugin/src/test/resources/org/apache/cayenne/tools/my-test.gradle
new file mode 100644
index 0000000..7b74f37
--- /dev/null
+++ b/cayenne-gradle-plugin/src/test/resources/org/apache/cayenne/tools/my-test.gradle
@@ -0,0 +1,44 @@
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+
+plugins {
+    id 'org.apache.cayenne'
+}
+apply plugin:'java'
+cdbimport {
+    map 'datamap.map.xml'
+
+    adapter 'org.apache.cayenne.dba.derby.DerbyAdapter'
+
+    dataSource {
+        username 'sa'
+        password ''
+        url 'jdbc:derby:build/testdb;create=true'
+        driver 'org.apache.derby.jdbc.EmbeddedDriver'
+    }
+}
+
+dependencies {
+    compile 'mysql:mysql-connector-java:6.0.5'
+}
+
+repositories {
+    mavenLocal()
+    mavenCentral()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/pom.xml b/maven-plugins/cayenne-maven-plugin/pom.xml
index 93d8164..a66bb21 100644
--- a/maven-plugins/cayenne-maven-plugin/pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/pom.xml
@@ -13,8 +13,8 @@
 
 	<parent>
 		<artifactId>cayenne-maven-plugins-parent</artifactId>
-		<groupId>org.apache.cayenne.plugins</groupId>
-		<version>4.1.M2-SNAPSHOT</version>
+			<groupId>org.apache.cayenne.plugins</groupId>
+			<version>4.1.M2-SNAPSHOT</version>
 	</parent>
 
 	<modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
index 2b50ade..88d720e 100644
--- a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
+++ b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbGeneratorMojo.java
@@ -26,6 +26,7 @@ import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dbsync.DbSyncModule;
 import org.apache.cayenne.di.AdhocObjectFactory;
+import org.apache.cayenne.di.ClassLoaderManager;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.log.NoopJdbcEventLogger;
@@ -33,6 +34,8 @@ import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.dbsync.reverse.configuration.ToolsModule;
 import org.apache.cayenne.resource.URLResource;
 import org.apache.cayenne.util.Util;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
 import org.slf4j.Logger;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -47,10 +50,10 @@ import java.sql.Driver;
 /**
  * Maven mojo to perform class generation from data map. This class is a Maven
  * adapter to DefaultClassGenerator class.
- * 
+ *
  * @since 3.0
  */
-@Mojo(name = "cdbgen", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST)
+@Mojo(name = "cdbgen", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST, requiresDependencyResolution = ResolutionScope.COMPILE)
 public class DbGeneratorMojo extends AbstractMojo {
 
     /**
@@ -111,6 +114,9 @@ public class DbGeneratorMojo extends AbstractMojo {
     @Parameter(defaultValue = "true")
     private boolean createFK;
 
+    @Parameter(defaultValue = "${project}")
+    private MavenProject project;
+
     public void execute() throws MojoExecutionException, MojoFailureException {
 
         Logger logger = new MavenLogger(this);
@@ -118,7 +124,8 @@ public class DbGeneratorMojo extends AbstractMojo {
         // check missing data source parameters
         dataSource.validate();
 
-        Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(logger));
+        Injector injector = DIBootstrap.createInjector(new DbSyncModule(), new ToolsModule(logger),
+                binder -> binder.bind(ClassLoaderManager.class).toInstance(new MavenPluginClassLoaderManager(project)));
         AdhocObjectFactory objectFactory = injector.getInstance(AdhocObjectFactory.class);
 
         logger.info(String.format("connection settings - [driver: %s, url: %s, username: %s]",
@@ -158,7 +165,9 @@ public class DbGeneratorMojo extends AbstractMojo {
         }
     }
 
-    /** Loads and returns DataMap based on <code>map</code> attribute. */
+    /**
+     * Loads and returns DataMap based on <code>map</code> attribute.
+     */
     private DataMap loadDataMap(Injector injector) throws Exception {
         return injector.getInstance(DataMapLoader.class).load(new URLResource(map.toURI().toURL()));
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
index 7da60af..61e36e7 100644
--- a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
+++ b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
@@ -26,16 +26,16 @@ import org.apache.cayenne.dbsync.reverse.dbimport.DbImportConfigurationValidator
 import org.apache.cayenne.dbsync.reverse.dbimport.DbImportModule;
 import org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering;
 import org.apache.cayenne.dbsync.reverse.filters.FiltersConfigBuilder;
+import org.apache.cayenne.di.ClassLoaderManager;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.util.Util;
+import org.apache.maven.plugins.annotations.*;
+import org.apache.maven.project.MavenProject;
 import org.slf4j.Logger;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
 
 import java.io.File;
 
@@ -44,7 +44,7 @@ import java.io.File;
  *
  * @since 3.0
  */
-@Mojo(name = "cdbimport", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
+@Mojo(name = "cdbimport", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
 public class DbImporterMojo extends AbstractMojo {
 
     /**
@@ -84,18 +84,25 @@ public class DbImporterMojo extends AbstractMojo {
     @Parameter(name = "dbimport", property = "dbimport", alias = "dbImport")
     private ReverseEngineering dbImportConfig = new ReverseEngineering();
 
+    @Parameter(defaultValue = "${project}" )
+    private MavenProject project;
+
     public void execute() throws MojoExecutionException, MojoFailureException {
 
-        Logger logger = new MavenLogger(this);
+        final Logger logger = new MavenLogger(this);
+
+        if (project == null) {
+            throw new MojoExecutionException("Can't load MavenProject.");
+        }
 
         // check missing data source parameters
         dataSource.validate();
+        final DbImportConfiguration config = createConfig(logger);
+        final Injector injector = DIBootstrap.createInjector(
+                new DbSyncModule(), new ToolsModule(logger), new DbImportModule(),
+                binder -> binder.bind(ClassLoaderManager.class).toInstance(new MavenPluginClassLoaderManager(project)));
 
-        DbImportConfiguration config = createConfig(logger);
-        Injector injector = DIBootstrap.createInjector(
-                new DbSyncModule(), new ToolsModule(logger), new DbImportModule());
-
-        DbImportConfigurationValidator validator = new DbImportConfigurationValidator(
+        final DbImportConfigurationValidator validator = new DbImportConfigurationValidator(
                 dbImportConfig, config, injector);
         try {
             validator.validate();
@@ -106,7 +113,7 @@ public class DbImporterMojo extends AbstractMojo {
         try {
             injector.getInstance(DbImportAction.class).execute(config);
         } catch (Exception ex) {
-            Throwable th = Util.unwindException(ex);
+           final Throwable th = Util.unwindException(ex);
 
             String message = "Error importing database schema";
 
@@ -119,7 +126,7 @@ public class DbImporterMojo extends AbstractMojo {
         }
     }
 
-    DbImportConfiguration createConfig(Logger logger) {
+    DbImportConfiguration createConfig(final Logger logger) {
 
         DbImportConfiguration config = new DbImportConfiguration();
         if (dbImportConfig.getCatalogs().size() == 0 && dbImportConfig.isEmptyContainer()) {
@@ -156,21 +163,21 @@ public class DbImporterMojo extends AbstractMojo {
     /**
      * Used only in tests, Maven will inject value directly into the "map" field
      */
-    public void setMap(File map) {
+    public void setMap(final File map) {
         this.map = map;
     }
 
     /**
      * This setter is used by Maven when defined {@code <dbimport>} tag
      */
-    public void setDbimport(ReverseEngineering dbImportConfig) {
+    public void setDbimport(final ReverseEngineering dbImportConfig) {
         this.dbImportConfig = dbImportConfig;
     }
 
     /**
      * This setter is used by Maven {@code <dbImport>} tag
      */
-    public void setDbImport(ReverseEngineering dbImportConfig) {
+    public void setDbImport(final ReverseEngineering dbImportConfig) {
         this.dbImportConfig = dbImportConfig;
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenPluginClassLoaderManager.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenPluginClassLoaderManager.java b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenPluginClassLoaderManager.java
new file mode 100644
index 0000000..cff8961
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/MavenPluginClassLoaderManager.java
@@ -0,0 +1,83 @@
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+import org.apache.cayenne.di.ClassLoaderManager;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Maven class loader manager to update class loader urls with project dependencies.
+ *
+ * @since 4.1
+ */
+public class MavenPluginClassLoaderManager implements ClassLoaderManager {
+
+    private MavenProject project;
+    private List<URL> urls = new ArrayList<>();
+
+    public MavenPluginClassLoaderManager(final MavenProject project) {
+        this.project = project;
+    }
+
+    @Override
+    public ClassLoader getClassLoader(final String resourceName) {
+        return buildClassLoader();
+    }
+
+    private void addUrlFromArtifact(final Artifact artifact) {
+
+        if (artifact == null) {
+            return;
+        }
+
+        addUrlFromFile(artifact.getFile());
+    }
+
+    private void addUrlFromFile(final File file) {
+        try {
+            System.out.println("Add URI to classpath: " + file.toURI());
+            urls.add(file.toURI().toURL());
+        } catch (Exception ignored) {
+        }
+    }
+
+    private ClassLoader buildClassLoader() {
+        @SuppressWarnings("unchecked")
+        final Set<Artifact> artifacts = project.getDependencyArtifacts();
+        if (artifacts != null) {
+            for (final Artifact artifact : artifacts) {
+                addUrlFromArtifact(artifact);
+            }
+        }
+
+        addUrlFromArtifact(project.getArtifact());
+
+        return new URLClassLoader(urls.toArray(new URL[0]), getClass().getClassLoader());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/ArtifactStub.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/ArtifactStub.java b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/ArtifactStub.java
new file mode 100644
index 0000000..34a0e20
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/ArtifactStub.java
@@ -0,0 +1,34 @@
+package org.apache.cayenne.stubs;
+
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.codehaus.plexus.PlexusTestCase;
+
+import java.io.File;
+
+public class ArtifactStub
+        extends DefaultArtifact
+{
+    public ArtifactStub( String groupId, String artifactId, String version, String packaging, String scope )
+    {
+        this( groupId, artifactId, version, packaging, null, scope );
+    }
+
+    public ArtifactStub( String groupId, String artifactId, String version, String packaging, String classifier, String scope )
+    {
+        super( groupId, artifactId, VersionRange.createFromVersion( version ), scope, packaging,
+                classifier, new DefaultArtifactHandler( packaging ), false );
+    }
+
+    public File getFile()
+    {
+        return new File( PlexusTestCase.getBasedir() + "/target/local-repo", getArtifactId() + "-" + getVersion() + "." + getType() )
+        {
+            public long lastModified()
+            {
+                return System.currentTimeMillis();
+            }
+        };
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/CayenneProjectStub.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/CayenneProjectStub.java b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/CayenneProjectStub.java
new file mode 100644
index 0000000..36dd95a
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/stubs/CayenneProjectStub.java
@@ -0,0 +1,21 @@
+package org.apache.cayenne.stubs;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class CayenneProjectStub extends MavenProjectStub{
+
+    public CayenneProjectStub()
+    {
+        Set artifacts = new HashSet();
+
+        artifacts.add( new ArtifactStub( "assembly", "dependency-artifact1", "1.0", "jar", Artifact.SCOPE_COMPILE ) );
+        artifacts.add( new ArtifactStub( "assembly", "dependency-artifact2", "1.0", "jar", Artifact.SCOPE_RUNTIME ) );
+        artifacts.add( new ArtifactStub( "assembly", "dependency-artifact3", "1.0", "jar", Artifact.SCOPE_TEST ) );
+
+        setDependencyArtifacts( artifacts );
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
index 3db8143..b8e883f 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
+++ b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
@@ -24,6 +24,11 @@ import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
 import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
 import org.apache.cayenne.test.jdbc.SQLReader;
 import org.apache.cayenne.test.resource.ResourceUtil;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingRequest;
 import org.slf4j.Logger;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
@@ -355,6 +360,8 @@ public class DbImporterMojoTest extends AbstractMojoTestCase {
     }
 
     private void test(String name) throws Exception {
+//        MavenProject mavenProject = getMavenProject("src/test/resources/org/apache/cayenne/tools/dbimport/" + name + "-pom.xml");
+
         DbImporterMojo cdbImport = getCdbImport("dbimport/" + name + "-pom.xml");
         File mapFile = cdbImport.getMap();
         File mapFileCopy = new File(mapFile.getParentFile(), "copy-" + mapFile.getName());
@@ -463,4 +470,13 @@ public class DbImporterMojoTest extends AbstractMojoTestCase {
             }
         }
     }
+
+
+    private MavenProject getMavenProject(String pomPath) throws Exception {
+        File pom = new File(pomPath);
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+        request.setPom(pom);
+        ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
+        return lookup( ProjectBuilder.class ).build( pom, configuration ).getProject();
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
index a4ccf75..dcc693c 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testAddedFlattenedRelationship-pom.xml
@@ -23,7 +23,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -41,6 +45,7 @@
                             <name>SCHEMA_01</name>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
index 98dc674..8c01c8f 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testComplexChangeOrder-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -36,6 +40,8 @@
                     <dbimport>
                         <schema>SCHEMA_01</schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
index 8ba74e2..a6696bf 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testCustomObjectLayerSettings-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -43,6 +47,8 @@
                             <name>SCHEMA_01</name>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
index 0fcafcb..3719f08 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDbAttributeChange-pom.xml
@@ -22,6 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
 
     <build>
         <plugins>
@@ -39,6 +44,8 @@
                             <name>SCHEMA_01</name>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
index c62c68f..b4bc513 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -39,6 +43,8 @@
                         <defaultPackage>com.example.test</defaultPackage>
                         <schema>SCHEMA_01</schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationship-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationship-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationship-pom.xml
index 590676f..184326e 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationship-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationship-pom.xml
@@ -21,7 +21,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -47,6 +51,8 @@
                             <excludeRelationship>test11</excludeRelationship>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationshipFirst-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationshipFirst-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationshipFirst-pom.xml
index 5501d70..6dea082 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationshipFirst-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testExcludeRelationshipFirst-pom.xml
@@ -21,7 +21,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -41,6 +45,8 @@
                             <excludeRelationship>test1</excludeRelationship>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
index f7d6adb..82d0d34 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -37,6 +41,8 @@
                     <dbimport>
                         <schema>SCHEMA_01</schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
index 7b454d8..b4ebf7a 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFkAttributeRename-pom.xml
@@ -23,7 +23,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -41,6 +45,8 @@
                             <name>SCHEMA_01</name>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
index f4ec9c7..8fb1ba7 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFlattensManyToManyWithRecursiveLink-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -36,6 +40,8 @@
 					<dbimport>
                     	<defaultPackage>org.not.my.home</defaultPackage>
 					</dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
index 81e54cc..a320223 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema-pom.xml
@@ -22,6 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
 
     <build>
         <plugins>
@@ -42,6 +47,8 @@
 
                         <schema>SCHEMA_01</schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
index 01f76e0..4153cd8 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -33,6 +37,8 @@
 						<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
 						<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
 					</dataSource>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
index f1465e0..a77ff66 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -33,6 +37,8 @@
                     	<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
                     	<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
 					</dataSource>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewRelationship-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewRelationship-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewRelationship-pom.xml
index 263280b..9e8a90d 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewRelationship-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewRelationship-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -36,6 +40,8 @@
                     <dbimport>
                         <schema>SCHEMA_01</schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
index 56995b3..ceae2c1 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportWithoutChanges-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
 	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -33,6 +37,8 @@
 						<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
 						<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
 					</dataSource>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testInheritance-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testInheritance-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testInheritance-pom.xml
index 27fca57..80de8a5 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testInheritance-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testInheritance-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
 	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -33,6 +37,8 @@
 						<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
 						<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
 					</dataSource>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
index 347ea13..7165e98 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
@@ -24,6 +24,12 @@
 
     <name>DbImporterMojo Test1</name>
 
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
+
     <build>
         <plugins>
             <plugin>
@@ -38,9 +44,10 @@
                         <schema>SCHEMA_01</schema>
                         <useJava7Types>true</useJava7Types>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
                 </configuration>
+
             </plugin>
         </plugins>
     </build>
-
 </project>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
index ea39308..019cb4f 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
@@ -23,6 +23,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
 
     <build>
         <plugins>
@@ -38,6 +43,7 @@
                         <schema>SCHEMA_01</schema>
                         <useJava7Types>false</useJava7Types>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
index 299b475..2ba3b29 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testOneToOne-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -33,6 +37,8 @@
 						<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
 						<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
 					</dataSource>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
index eb15cd6..b841aa2 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveCustomObjMappings-pom.xml
@@ -22,6 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
 
     <build>
         <plugins>
@@ -39,6 +44,8 @@
                             <name>SCHEMA_01</name>
                         </schema>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
index ae2b8b5..5c54d88 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testPreserveRelationships-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -37,6 +41,8 @@
                         <!-- it doesn't matter true or false, but initial question was about this flag -->
                         <skipRelationshipsLoading>true</skipRelationshipsLoading>
                     </dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
index 74867d4..0b966a1 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -40,6 +44,8 @@
                         </schema>
                         <excludeTable>Child</excludeTable>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
index 1b5c8fc..0cff2f6 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipPrimaryKeyLoading-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -37,6 +41,8 @@
                     <dbimport>
                         <skipPrimaryKeyLoading>true</skipPrimaryKeyLoading>
                     </dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
index f2b4c11..481333a 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSkipRelationshipsLoading-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -37,6 +41,8 @@
                     <dbimport>
                         <skipRelationshipsLoading>true</skipRelationshipsLoading>
                     </dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
index daf5b59..4e71422 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSupportsCatalogsOnReverseEngineering-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -42,6 +46,8 @@
                     <dbimport>
                         <catalog>DbImporterMojoTest1</catalog>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
index ff20c79..c079826 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testTableTypes-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -37,6 +41,8 @@
                     <dbimport>
                         <tableType>TABLE</tableType>
                     </dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
index 0c80294..75af04a 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testUnFlattensManyToMany-pom.xml
@@ -21,8 +21,12 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-	<name>DbImporterMojo Test1</name>	
+	<name>DbImporterMojo Test1</name>
+	<groupId>org.apache.maven.plugin-testing</groupId>
+	<artifactId>maven-plugin-testing</artifactId>
+	<version>1.0-SNAPSHOT</version>
 
+	<modelVersion>4.0.0</modelVersion>
 	<build>
 		<plugins>
 			<plugin>
@@ -36,6 +40,8 @@
 					<dbimport>
                     	<defaultPackage>org.not.my.home</defaultPackage>
 					</dbimport>
+					<project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
 				</configuration>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c161a439/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
index 1d5f4c0..9dfbc90 100644
--- a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
+++ b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude-pom.xml
@@ -22,7 +22,11 @@
 	http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
     <name>DbImporterMojo Test1</name>
+    <groupId>org.apache.maven.plugin-testing</groupId>
+    <artifactId>maven-plugin-testing</artifactId>
+    <version>1.0-SNAPSHOT</version>
 
+    <modelVersion>4.0.0</modelVersion>
     <build>
         <plugins>
             <plugin>
@@ -37,6 +41,8 @@
                     <dbimport>
                         <excludeTable>^V_.*</excludeTable>
                     </dbimport>
+                    <project implementation="org.apache.cayenne.stubs.CayenneProjectStub"/>
+
                 </configuration>
             </plugin>
         </plugins>


Mime
View raw message