openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Watler <wat...@wispertel.net>
Subject Re: maven-openjpa-plugin problem
Date Thu, 12 Feb 2009 03:33:47 GMT
We have a multi-module build for Jetspeed2. Here are the relevant parts 
of the root pom.xml:

  ...
  <properties>
    ...
    <openjpa.version>1.2.0</openjpa.version>
    ...
  </properties>
  ...
  <dependencyManagement>
    <dependencies>
      ...
      <dependency>
        <groupId>org.apache.openjpa</groupId>
        <artifactId>openjpa-persistence-jdbc</artifactId>
        <version>${openjpa.version}</version>
        <exclusions>
          <exclusion>
            <groupId>ant</groupId>
            <artifactId>ant</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      ...        
    </dependencies>
  </dependencyManagement>
  ...
  <build>
    <pluginManagement>
      <plugins>
         ...
         <!-- OpenJPA Enhancer maven plugin -->
         <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>openjpa-maven-plugin</artifactId>
          <version>1.0-alpha</version>
          <dependencies>
            ...
            <!-- force upgrade of OpenJPA for plugin -->
            <dependency>
              <groupId>org.apache.openjpa</groupId>
              <artifactId>openjpa-persistence-jdbc</artifactId>
              <version>${openjpa.version}</version>
              <scope>runtime</scope>
            </dependency>
          </dependencies>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
  </build>
  ...

Then, in our module pom.xml files:

  ...
  <dependencies>
    ...
    <dependency>
      <groupId>org.apache.openjpa</groupId>
      <artifactId>openjpa-persistence-jdbc</artifactId>
    </dependency>
    ...        
  </dependencies>
  ...
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>openjpa-maven-plugin</artifactId>
        <executions>
          ...
          <execution>
            <id>org.apache.jetspeed.jpa</id>
            <phase>process-classes</phase>
            <goals>
              <goal>enhance</goal>
            </goals>
            <configuration>
              <classes>${project.build.directory}/classes/org/apache/jetspeed/jpa</classes>
              <toolProperties>
                <property>
                  <name>addDefaultConstructor</name>
                  <value>true</value>
                </property>
                <property>
                  <name>enforcePropertyRestrictions</name>
                  <value>true</value>
                </property>
              </toolProperties>
            </configuration>
          </execution>
          ...
        </executions>
      </plugin>
      ...
    </plugins>
  </build>
  ...


HTH, good luck!

Randy Watler

Rick Curtis wrote:
> Randy -
>
> I'd like to take a look at your pom.xml.
>
> Rick
>
>
> Randy Watler wrote:
>   
>> Kevin/Rick/David:
>>
>> I believe there is a simple way to upgrade the OpenJPA version for use 
>> with the Maven2 plugin. Try adding a plugin dependency for OpenJPA with 
>> your target version. It seems to work for us over here in the Jetspeed 
>> project. We're using OpenJPA 1.2.0. Of course, YMMV. Let me know if I 
>> can help or if you want me to paste an example pom.xml here.
>>
>> Randy Watler
>>
>> Kevin Sutter wrote:
>>     
>>> Is this worth "enhancing" (pardon the pun)?  Seriously, is this maven
>>> plugin
>>> worth supporting?  Or, possibly bringing into our svn?
>>>
>>> On Wed, Feb 11, 2009 at 4:08 PM, Rick Curtis <curtisr7@gmail.com> wrote:
>>>
>>>   
>>>       
>>>> Dave -
>>>> I struggled with this very problem yesterday and never did get it to
>>>> work
>>>> properly. I ended up using the ant-run plugin to invoke the OpenJPA
>>>> enhancer
>>>> task.
>>>>
>>>> Rick
>>>>
>>>>
>>>> David Goodenough-3 wrote:
>>>>     
>>>>         
>>>>> I am trying to the the OpenJPA plugin so that I can use the static
>>>>> enhancer as
>>>>> part of my Maven2 build.  But when I run it it seems to be drawing in
>>>>>       
>>>>>           
>>>> very
>>>>     
>>>>         
>>>>> old
>>>>> versions of OpenJPA.
>>>>>
>>>>> Is this plugin useable with current versions of OpenJPA, and if not is
>>>>> there
>>>>> a newer version of the mojo around anywhere?
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>>       
>>>>>           
>>>> --
>>>> View this message in context:
>>>> http://n2.nabble.com/maven-openjpa-plugin-problem-tp2311703p2311733.html
>>>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Mime
View raw message