c12
c12

Reputation: 9827

Error finding jpa-ddl-maven-plugin for DDL Generation from JPA Entities

I'm trying to use the jpa-ddl-maven-plugin as described here but I'm getting a the below error using Apache Maven 3.0.3. Any ideas where I've gone wrong?

my pom.xml:

<plugin>

                   <groupId>it.linksmt.tooling</groupId>

                   <artifactId>maven-jpa-ddl-plugin</artifactId>

                   <version>1.0.0-SNAPSHOT</version>

                   <extensions>true</extensions>

                   <configuration>

                           <targetDbPlatform>OraclePlatform</targetDbPlatform>

                           <persistenceUnitName>test-entity-api</persistenceUnitName>

                           <persistenceUnitFile>META-INF/persistence.xml</persistenceUnitFile>

                   </configuration>

            </plugin>

settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <pluginGroups>
        <pluginGroup>it.linksmt.tooling</pluginGroup>
    </pluginGroups>
</settings>

Error:

WARNING] The POM for it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.test.sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

mvn clean install -e output:

ERROR]   
[ERROR]   The project com.test:sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
org.apache.maven.plugin.PluginResolutionException: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:215)
    at org.apache.maven.project.DefaultProjectBuildingHelper.resolveExtensionArtifacts(DefaultProjectBuildingHelper.java:377)
    at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm(DefaultProjectBuildingHelper.java:237)
    at org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled(DefaultModelBuildingListener.java:106)
    at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire(ModelBuildingEventCatapult.java:43)
    at org.apache.maven.model.building.DefaultModelBuilder.fireEvent(DefaultModelBuilder.java:1041)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:391)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:374)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:536)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:328)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:632)
    at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:581)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:207)
    ... 26 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:531)
    ... 29 more

Upvotes: 0

Views: 271

Answers (1)

Dror Bereznitsky
Dror Bereznitsky

Reputation: 20376

You are trying to use a SNAPSHOT version of the plugin, which will not be found in Maven's default repository - Maven Central.
Looking at the plugin Google code page, it seems that it is currently in beta and has no release version.
You have a couple of options for resolving this plugin:

  1. build it from the source as described here and install it to your local Maven repository. This will be useful only on your machine.
  2. build the plugin and deploy it to a repository manager such as Artifactory. This will help you sharing the plugin with other team members/CI server.
  3. Resolve the plugin from this repository. Notice, I found it by searching Google, but have no idea who is managing it. You will have to define a new repository for this.

Upvotes: 1

Related Questions