[
http://jira.codehaus.org/browse/MHIBERNATE-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=263587#action_263587
]
Stevo Slavic commented on MHIBERNATE-90:
----------------------------------------
I cleared local repo, configured codehause snapshots as plugin repository and
configured 3.0-SNAPSHOT as plugin version in plugin management. Build run, and
failed. I checked, hibernate3-maven-plugin-3.0-20110414.115409-5.jar has been
pulled in local repo. Following is relevant build output snippet:
{noformat:title=build output}
[ERROR] Failed to execute goal
org.codehaus.mojo:hibernate3-maven-plugin:3.0-SNAPSHOT:hbm2ddl
(generate-schema-drop-ddl)
on project foo.bar.model: There was an error creating the AntRun task.
NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.codehaus.mojo:hibernate3-maven-plugin
:3.0-SNAPSHOT:hbm2ddl (generate-schema-drop-ddl) on project foo.bar.model:
There was an error creating the AntRun task.
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
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.apache.maven.plugin.MojoExecutionException: There was an error
creating the AntRun task.
at
org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:84)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at
org.codehaus.plexus.configuration.DefaultPlexusConfiguration.add(DefaultPlexusConfiguration.java:174)
at
org.codehaus.plexus.configuration.DefaultPlexusConfiguration.addChild(DefaultPlexusConfiguration.java:150)
at
org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.setHibernateConfiguration(PlexusConfigurationUtils
.java:289)
at
org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.parseHibernateTool(PlexusConfigurationUtils.java:6
7)
at
org.codehaus.mojo.hibernate3.AbstractHibernateToolMojo.getConfiguration(AbstractHibernateToolMojo.java:60)
at
org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:76)
... 21 more
{noformat}
And this is the plugin configuration
{noformat:title=pom.xml}
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-schema-drop-ddl</id>
<phase>process-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
<outputDirectory>target/generated-resources/hibernate3/sql-jpa</outputDirectory>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>false</create>
<export>false</export>
<console>false</console>
<jdk5>true</jdk5>
<outputfilename>schema-drop.sql</outputfilename>
<configurationfile>hibernate.cfg.xml</configurationfile>
<persistenceunit>foo-bar-persistence_unit</persistenceunit>
<namingstrategy>foo.bar.hibernate.CustomNamingStrategy</namingstrategy>
</componentProperties>
</configuration>
</execution>
<execution>
<id>generate-schema-create-ddl</id>
<phase>process-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
<outputDirectory>target/generated-resources/hibernate3/sql-jpa</outputDirectory>
</component>
</components>
<componentProperties>
<drop>false</drop>
<create>true</create>
<export>false</export>
<console>false</console>
<jdk5>true</jdk5>
<outputfilename>schema-create.sql</outputfilename>
<configurationfile>hibernate.cfg.xml</configurationfile>
<persistenceunit>foo-bar-persistence_unit</persistenceunit>
<namingstrategy>foo.bar.hibernate.CustomNamingStrategy</namingstrategy>
</componentProperties>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>${net.sourceforge.jtds.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>${org.hibernate.javax.persistence.hibernate-jpa-2.0-api.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${org.hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${org.hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${org.hibernate.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${javax.validation.validation-api.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${org.hibernate.hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>foo.bar.hibernate</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
{noformat}
{noformat:title=hibernate-cfg.xml}
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">foo.bar.hibernate.dialect.CustomSQLServer2008Dialect</property>
</session-factory>
</hibernate-configuration>
{noformat}
{noformat:title=persistence.xml}
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="foo-bar-persistence_unit"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/orm.xml</mapping-file>
<properties>
<property name="hibernate.dialect"
value="foo.bar.hibernate.dialect.CustomSQLServer2008Dialect"/>
<property name="hibernate.ejb.naming_strategy"
value="foo.bar.hibernate.CustomNamingStrategy"/>
</properties>
</persistence-unit>
</persistence>
{noformat}
{noformat:title=orm.xml}
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<package>foo.bar.model</package>
</entity-mappings>
{noformat}
I'm using:
- Apache Maven - 3.0.3
- org.hibernate.version - 3.6.1.Final
- hibernate.javax.persistence.hibernate-jpa-2.0-api.version - 1.0.0.Final
- javax.validation.validation-api.version - 1.0.0.GA
- org.hibernate.hibernate-validator.version - 4.1.0.Final
- net.sourceforge.jtds.version - 1.2.4
Btw, I just tried building plugin sources myself, with no local modifications
jpa-hbm2ddl-envers-3.6 IT regularly fails
{noformat}
[INFO] The build exited with code 1. See
D:\oss\hibernate3-maven-plugin\eclipse_workspace\hibernate3-maven-plugin-3.0-
SNAPSHOT\target\it\jpa-hbm2ddl-envers-3.6\build.log for details.
{noformat}
{noformat:title=build.log}
[ERROR] Failed to execute goal on project jpa-hbm2ddl-envers: Could not resolve
dependencies for project
org.codehaus.mojo.hibernate3.it:jpa-hbm2ddl-envers:jar:testing: The following
artifacts could not be resolved:
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,
org.hibernate:hibernate-envers:jar:3.6.0.Final: Could not find artifact
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in local.central
(file:///C:/Users/s.slavic/.m2/repository) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
on project jpa-hbm2ddl-envers: Could not resolve dependencies for project
org.codehaus.mojo.hibernate3.it:jpa-hbm2ddl-envers:jar:testing: The following
artifacts could not be resolved:
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,
org.hibernate:hibernate-envers:jar:3.6.0.Final: Could not find artifact
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in local.central
(file:///C:/Users/s.slavic/.m2/repository)
at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:196)
at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:108)
at
org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
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.apache.maven.project.DependencyResolutionException: Could not
resolve dependencies for project
org.codehaus.mojo.hibernate3.it:jpa-hbm2ddl-envers:jar:testing: The following
artifacts could not be resolved:
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,
org.hibernate:hibernate-envers:jar:3.6.0.Final: Could not find artifact
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in local.central
(file:///C:/Users/s.slavic/.m2/repository)
at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:170)
at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:171)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The
following artifacts could not be resolved:
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,
org.hibernate:hibernate-envers:jar:3.6.0.Final: Could not find artifact
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in local.central
(file:///C:/Users/s.slavic/.m2/repository)
at
org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:412)
at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:164)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The
following artifacts could not be resolved:
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,
org.hibernate:hibernate-envers:jar:3.6.0.Final: Could not find artifact
org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in local.central
(file:///C:/Users/s.slavic/.m2/repository)
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)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not
find artifact org.hibernate:hibernate-entitymanager:jar:3.6.0.Final in
local.central (file:///C:/Users/s.slavic/.m2/repository)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:945)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460)
... 26 more
{noformat}
After replacing in
hibernate3-maven-plugin-3.0-SNAPSHOT/src/it/jpa-hbm2ddl-envers-3.6/pom.xml
http://repository.jboss.org/maven2 with
https://repository.jboss.org/nexus/content/groups/public-jboss build was
successful.
If this pluggin just runs Ant tasks, then I see no point in using it (just
limts configuration options), will use maven-antrun-plugin and configure
build.xml that will make use of EnversHibernateToolTask.
> Support for Hibernate Envers
> -----------------------------
>
> Key: MHIBERNATE-90
> URL: http://jira.codehaus.org/browse/MHIBERNATE-90
> Project: Maven 2.x Hibernate Plugin
> Issue Type: Improvement
> Components: hbm2ddl
> Affects Versions: 2.2
> Environment: All environments
> Reporter: Viktor Rees
> Assignee: Johann Reyes
> Fix For: 3.0
>
>
> The hibernate sub project Envers is not supported jet by the
> hibernate3-maven-plugin. See http://www.jboss.org/envers/
> This project creates version tables for all selected 'normal' tables. In the
> version tables all historical data is stored for each update, delete insert
> command of the 'normal' tables.
> The problem is that mvn hibernate3:hbm2ddl does create database schema for
> the normal tables but not for the version tables.
> Is this feature planned to get implemented?
> Viktor
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email