Question

Obviously the documentations are outdated and even having mistakes.

This is my POM file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mg.labs.jdo</groupId>
    <artifactId>jdo-enhancement</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <name>jdo-enhancement</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-accessplatform-jdo-rdbms</artifactId>
            <version>3.3.0-release</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-maven-plugin</artifactId>
                <version>3.3.0-release</version>
                <configuration>
                    <api>JDO</api>
                    <props>${basedir}/datanucleus.properties</props>
                    <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                    <verbose>true</verbose>
                </configuration>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>enhance</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
  1. The api and enhancer versions stated in the docs for for an old version. How can I use 3.3.8 or 4.0.0.M2 instead ? Simply changing the numbers didn't work !
  2. Eclipse is showing the following error Plugin execution not covered by lifecycle configuration: org.datanucleus:datanucleus-maven-plugin:3.3.0-release:enhance (execution: default, phase: process-classes)
  3. Running the goals install shows the following error:

    Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/3.2.5/datanucleus-core-3.2.5.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/4.0.0-m2/datanucleus-core-4.0.0-m2.jar."

Although I haven't included versions 3.2.5 nor 4.0.0-m2. I wish I could be using the latest version but I don't know how, as I said, changing the version numbers doesn't work as expected.

My main goal is to run package and enhance the classes before packaging, which is just what the documentation tries to do. How to do that with the latest datanculeus release version ?

EDIT I debugged as Neil adviced, there is what I think is significant: (At the beginning, these lines indicate the dependencies for the included maven dependency)

[DEBUG] mg.labs.jdo:jdo-enhancement:jar:1.0
[DEBUG]    org.datanucleus:datanucleus-accessplatform-jdo-rdbms:pom:3.3.0-release:compile
[DEBUG]       javax.jdo:jdo-api:jar:3.0.1:compile
[DEBUG]          javax.transaction:jta:jar:1.1:compile
[DEBUG]       org.datanucleus:datanucleus-core:jar:3.2.5:compile
[DEBUG]       org.datanucleus:datanucleus-api-jdo:jar:3.2.4:compile
[DEBUG]       org.datanucleus:datanucleus-jdo-query:jar:3.0.2:compile
[DEBUG]       org.datanucleus:datanucleus-rdbms:jar:3.2.4:compile
[DEBUG]    junit:junit:jar:3.8.1:test

(These lines at the starts are the ones indicating some unexpected events for datanucleus plugin, such as not being able to download meta-data xml files and including datanucleus-core 4.0.0-m3 files, the successive lines are just a result of that faulty inclusion)

[INFO] --- datanucleus-maven-plugin:3.3.0-release:enhance (default) @ jdo-enhancement ---
[DEBUG] Could not find metadata org.datanucleus:datanucleus-core/maven-metadata.xml in local (/home/mgelbana/.m2/repository)
[DEBUG] Skipped remote update check for org.datanucleus:datanucleus-core/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for http://www.datanucleus.org/downloads/maven2/
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for https://oss.sonatype.org/content/repositories/snapshots
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/datanucleus/datanucleus-core/maven-metadata.xml
Downloading: http://www.datanucleus.org/downloads/maven2/org/datanucleus/datanucleus-core/maven-metadata.xml
[DEBUG] Writing tracking file /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/resolver-status.properties
[DEBUG] Writing tracking file /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/resolver-status.properties
[DEBUG] Could not find metadata org.datanucleus:datanucleus-core/maven-metadata.xml in DN_M2_Repo (http://www.datanucleus.org/downloads/maven2/)
[DEBUG] Could not find metadata org.datanucleus:datanucleus-core/maven-metadata.xml in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=41, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=18, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=40, DefaultDependencyCollector.collectTime=6063, DefaultDependencyCollector.transformTime=2}
[DEBUG] org.datanucleus:datanucleus-maven-plugin:jar:3.3.0-release:
[DEBUG]    org.datanucleus:datanucleus-core:jar:4.0.0-m3:runtime
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.8:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:3.0.4:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0.4:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.0.4:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG]                org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[DEBUG]    org.codehaus.plexus:plexus-container-default:jar:1.5.5:compile
[DEBUG]       org.codehaus.plexus:plexus-classworlds:jar:2.2.2:compile
[DEBUG]       org.apache.xbean:xbean-reflect:jar:3.4:compile
[DEBUG]          log4j:log4j:jar:1.2.12:compile
[DEBUG]          commons-logging:commons-logging-api:jar:1.1:compile
[DEBUG]       com.google.collections:google-collections:jar:1.0:compile
[DEBUG]       junit:junit:jar:3.8.2:compile
[DEBUG] Created new class realm plugin>org.datanucleus:datanucleus-maven-plugin:3.3.0-release
[DEBUG] Importing foreign packages into class realm plugin>org.datanucleus:datanucleus-maven-plugin:3.3.0-release
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.datanucleus:datanucleus-maven-plugin:3.3.0-release
[DEBUG]   Included: org.datanucleus:datanucleus-maven-plugin:jar:3.3.0-release
[DEBUG]   Included: org.datanucleus:datanucleus-core:jar:4.0.0-m3
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.8
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
[DEBUG]   Included: org.apache.xbean:xbean-reflect:jar:3.4
[DEBUG]   Included: log4j:log4j:jar:1.2.12
[DEBUG]   Included: commons-logging:commons-logging-api:jar:1.1
[DEBUG]   Included: com.google.collections:google-collections:jar:1.0
[DEBUG]   Included: junit:junit:jar:3.8.2
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:3.0.4
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:3.0.4
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:3.0.4
[DEBUG]   Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.5.5
[DEBUG]   Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.2.2
[DEBUG] Configuring mojo org.datanucleus:datanucleus-maven-plugin:3.3.0-release:enhance from plugin realm ClassRealm[plugin>org.datanucleus:datanucleus-maven-plugin:3.3.0-release, parent: sun.misc.Launcher$AppClassLoader@591ce4fe]
[DEBUG] Configuring mojo 'org.datanucleus:datanucleus-maven-plugin:3.3.0-release:enhance' with basic configurator -->
[DEBUG]   (f) alwaysDetachable = false
[DEBUG]   (f) api = JDO
[DEBUG]   (f) classpathElements = [/home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes, /home/mgelbana/.m2/repository/javax/jdo/jdo-api/3.0.1/jdo-api-3.0.1.jar, /home/mgelbana/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar, /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/3.2.5/datanucleus-core-3.2.5.jar, /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-api-jdo/3.2.4/datanucleus-api-jdo-3.2.4.jar, /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-jdo-query/3.0.2/datanucleus-jdo-query-3.0.2.jar, /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-rdbms/3.2.4/datanucleus-rdbms-3.2.4.jar]
[DEBUG]   (f) detachListener = false
[DEBUG]   (f) fork = true
[DEBUG]   (f) generateConstructor = true
[DEBUG]   (f) generatePK = true
[DEBUG]   (f) log4jConfiguration = /home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/log4j.properties
[DEBUG]   (f) metadataDirectory = /home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes
[DEBUG]   (f) metadataIncludes = **/*.jdo, **/*.class
[DEBUG]   (f) pluginArtifacts = [org.datanucleus:datanucleus-maven-plugin:maven-plugin:3.3.0-release:, org.datanucleus:datanucleus-core:jar:4.0.0-m3:runtime, org.codehaus.plexus:plexus-utils:jar:3.0.8:compile, org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile, org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile, org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile, org.sonatype.sisu:sisu-guava:jar:0.9.9:compile, org.apache.xbean:xbean-reflect:jar:3.4:compile, log4j:log4j:jar:1.2.12:compile, commons-logging:commons-logging-api:jar:1.1:compile, com.google.collections:google-collections:jar:1.0:compile, junit:junit:jar:3.8.2:compile]
[DEBUG]   (f) quiet = false
[DEBUG]   (f) verbose = true
[DEBUG] -- end configuration --
[DEBUG] Metadata Directory is : /home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes
[DEBUG] Executing command line:
[DEBUG] /bin/sh -c java -cp /home/mgelbana/.m2/repository/org/datanucleus/datanucleus-maven-plugin/3.3.0-release/datanucleus-maven-plugin-3.3.0-release.jar:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/4.0.0-m3/datanucleus-core-4.0.0-m3.jar:/home/mgelbana/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar:/home/mgelbana/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar:/home/mgelbana/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar:/home/mgelbana/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar:/home/mgelbana/.m2/repository/org/sonatype/sisu/sisu-guava/0.9.9/sisu-guava-0.9.9.jar:/home/mgelbana/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar:/home/mgelbana/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar:/home/mgelbana/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar:/home/mgelbana/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar:/home/mgelbana/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar:/home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes:/home/mgelbana/.m2/repository/javax/jdo/jdo-api/3.0.1/jdo-api-3.0.1.jar:/home/mgelbana/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/3.2.5/datanucleus-core-3.2.5.jar:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-api-jdo/3.2.4/datanucleus-api-jdo-3.2.4.jar:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-jdo-query/3.0.2/datanucleus-jdo-query-3.0.2.jar:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-rdbms/3.2.4/datanucleus-rdbms-3.2.4.jar -Dlog4j.configuration=file:/home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/log4j.properties org.datanucleus.enhancer.DataNucleusEnhancer -v -api JDO /home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes/mg/labs/jdo/enhancement/App.class /home/mgelbana/workspace/kepler_maven_by_example/jdo-enhancement/target/classes/mg/labs/jdo/enhancement/QApp.class
[DEBUG] Exit code: 1
[DEBUG] --------------------
[DEBUG]  Standard output from the DataNucleus tool org.datanucleus.enhancer.DataNucleusEnhancer :
[DEBUG] --------------------
[INFO] 
[DEBUG] --------------------
[ERROR] --------------------
[ERROR]  Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] Exception in thread "main" Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/3.2.5/datanucleus-core-3.2.5.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/4.0.0-m3/datanucleus-core-4.0.0-m3.jar."
org.datanucleus.exceptions.NucleusException: Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/3.2.5/datanucleus-core-3.2.5.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/home/mgelbana/.m2/repository/org/datanucleus/datanucleus-core/4.0.0-m3/datanucleus-core-4.0.0-m3.jar."
Was it helpful?

Solution

Well i simply changed all versions to the latest 4.0.0-m2 when I wanted to use it. Can't get simpler.

OTHER TIPS

Thanks to Neil's suggestion to check datanucleus's samples, here is a functioning POM file with JDO enhancer configured:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-samples-jdo-tutorial</artifactId>
    <packaging>jar</packaging>
    <version>4.0</version>
    <name>DataNucleus AccessPlatform Tutorial for JDO</name>
    <url>http://www.datanucleus.org</url>

    <repositories>
        <repository>
            <id>DN_M2_Repo</id>
            <name>DataNucleus Repository</name>
            <url>http://www.datanucleus.org/downloads/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>DataNucleus_2</id>
            <url>http://www.datanucleus.org/downloads/maven2/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-core</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-api-jdo</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo-api</artifactId>
            <version>[3.0, )</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>[1.2, 1.3)</version>
        </dependency>

        <!-- ENABLE THIS FOR H2 -->
        <dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-rdbms</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.168</version>
        </dependency>

        <!-- ENABLE THIS FOR HSQLDB -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-rdbms</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.4</version>
        </dependency-->

        <!-- ENABLE THIS FOR MYSQL -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-rdbms</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.17</version>
        </dependency-->

        <!-- ENABLE THIS FOR ODF -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-odf</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.odftoolkit</groupId>
            <artifactId>odfdom-java</artifactId>
            <version>0.8.7</version>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>[2.8, 3.0)</version>
        </dependency-->

        <!-- ENABLE THIS FOR EXCEL -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-excel</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.6</version>
        </dependency-->

        <!-- ENABLE THIS FOR MongoDB -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-mongodb</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>[2.5, 3.0)</version>
        </dependency-->

        <!-- ENABLE THIS FOR HBase -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-hbase</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>1.0.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-mapper-asl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.jackson</groupId>
                    <artifactId>jackson-core-asl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase</artifactId>
            <version>0.94.1</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.3</version>
        </dependency-->

        <!-- ENABLE THIS FOR Neo4j -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-neo4j</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>org.neo4j</groupId>
            <artifactId>neo4j</artifactId>
            <version>1.7.2</version>
        </dependency-->

        <!-- ENABLE THIS FOR Cassandra -->
        <!--dependency>
            <groupId>org.datanucleus</groupId>
            <artifactId>datanucleus-cassandra</artifactId>
            <version>[4.0.0-m1, )</version>
        </dependency>
        <dependency>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>2.0.0-rc2</version>
        </dependency-->
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.jdo</include>
                    <include>**/*.orm</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>*.log</include>
                                <include>tutorial.ods</include>
                                <include>tutorial.xls</include>
                                <include>testDB</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <!--configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration-->
            </plugin>
            <plugin>
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-maven-plugin</artifactId>
                <version>4.0.0-m1</version>
                <configuration>
                    <api>JDO</api>
                    <persistenceUnitName>Tutorial</persistenceUnitName>
                    <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                    <verbose>false</verbose>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>enhance</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1</version>
                <configuration>
                    <mainClass>org.datanucleus.samples.jdo.tutorial.Main</mainClass>
                    <systemProperties>
                        <systemProperty>
                            <key>log4j.configuration</key>
                            <value>file:${basedir}/log4j.properties</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <descriptors>
                        <descriptor>${basedir}/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top