Today seems that DataNucleus has updated Maven with a new version of the 
Enhancer (3.2.5) (and probably the Core).

Until now we were working with version 3.2.4.

That has break the Maven build process, as seems that the new Enhancer version 
uses an updated Data Nucleus Core version.

It's noticed because when building the project the following log is shown:

[INFO]   CP: 
/Users/oscarboubou/.m2/repository/org/springframework/spring-core/3.1.0.RELEASE/spring-core-3.1.0.RELEASE.jar
[INFO]   CP: 
/Users/oscarboubou/.m2/repository/org/jopendocument/jdom/1.1.1/jdom-1.1.1.jar
DataNucleus Enhancer (versiï¿?n 3.2.5) para el API "JDO" utilisando el JRE "1.6"
DataNucleus Enhancer : Classpath
>>  
>> /Applications/jbdevstudio7/studio/configuration/org.eclipse.osgi/bundles/1145/1/.cp/jars/plexus-classworlds-2.4.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.238s
[INFO] Finished at: Thu Jun 27 18:22:48 CEST 2013
[INFO] Final Memory: 8M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.datanucleus:datanucleus-maven-plugin:3.2.0-release:enhance (default) on 
project xms-framework-architecture-domain: Error executing DataNucleus tool 
org.datanucleus.enhancer.DataNucleusEnhancer: InvocationTargetException: 
org.datanucleus.metadata.CollectionMetaData.setEmbeddedElement(Ljava/lang/String;)Lorg/datanucleus/metadata/CollectionMetaData;
 -> [Help 1]
[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/MojoExecutionException


In order to force Maven to use the same version of the Enhancer, simply replace 
on the pom.xm of the "dom" package:

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.datanucleus</groupId>
                                
<artifactId>datanucleus-maven-plugin</artifactId>
                                <version>3.2.0-release</version>
                                <configuration>
                                        <fork>false</fork>
                                        
<log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                                        <verbose>true</verbose>
                                        
<props>${basedir}/datanucleus.properties</props>
                                </configuration>
                                <executions>
                                        <execution>
                                                <phase>compile</phase>
                                                <goals>
                                                        <goal>enhance</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
                <pluginManagement>
                        .....



By this:

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.datanucleus</groupId>
                                
<artifactId>datanucleus-maven-plugin</artifactId>
                                <version>3.2.0-release</version>
                                <!-- XMS -->
                                <dependencies>
                                        <dependency>
                                                <!-- Force the enhancer to use 
the same version of core that's already 
                                                        on the classpath -->
                                                
<groupId>org.datanucleus</groupId>
                                                
<artifactId>datanucleus-core</artifactId>
                                                <version>3.2.4</version>
                                        </dependency>
                                </dependencies>
                                <!-- XMS -->
                                <configuration>
                                        <fork>false</fork>
                                        
<log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                                        <verbose>true</verbose>
                                        
<props>${basedir}/datanucleus.properties</props>
                                </configuration>
                                <executions>
                                        <execution>
                                                <phase>compile</phase>
                                                <goals>
                                                        <goal>enhance</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
                <pluginManagement>
                        .....

If a property would be defined on the parent pom.xml, containing the 
datanucleus.core version, it could be instead:

<version>${datanucleus.core.version}</version>

Hope this helps.


Reply via email to