openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2009) OpenJPA trunk won't compile if folder %m2_home%/org/apache/openjpa/openjpa-all/2.2.0-SNAPSHOT does not exist
Date Thu, 09 Jun 2011 16:21:59 GMT


Michael Dick commented on OPENJPA-2009:

Running mvn install resolved the problem for me. The install phase will copy the openjpa-all
artifact to the local repository before the openbooks sample is compiled so all is good. 

The problem with mvn compile, is that the dependency on openjpa-all is picked up from the
local workspace (assuming you've done a build from the root openjpa directory). But the ant
task relies on the output of the build being copied to your local maven repository. 

If you've already downloaded the right level of OpenJPA, or regularly do mvn install builds
this is no problem - openjpa-all is already in place.

Probably the best fix is to update build.xml so it picks up the maven classpath (if it's available).
Might be a little ticklish if build.xml is intended for use outside of maven though. 

In the mean time, I found that step 1 in the workaround isn't needed. Just running mvn dependency:tree
or mvn install, or running mvn compile from the openjpa-examples directory will suffice. 

> OpenJPA trunk won't compile if folder %m2_home%/org/apache/openjpa/openjpa-all/2.2.0-SNAPSHOT
does not exist
> ------------------------------------------------------------------------------------------------------------
>                 Key: OPENJPA-2009
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: Windows XP, Maven 2.2.1, Oracle JDK 1.6.0_24
>            Reporter: Ognjen Blagojevic
>            Priority: Minor
> With clean maven repo, when running mvn compile it fails with message:
> [INFO] Building OpenJPA Examples - OpenBooks
> ...
> [INFO] Executing tasks
>      [echo] Running OpenBooks genmodel
> info:
>      [echo]
>      [echo]                     Builds OpenBooks demo application.
>      [echo]                     OpenJPA Library: d:/java/lib-maven2/repo/org/apache/openjpa/openjpa-all/2.2.0-SNAPSHOT
>      [echo]                     Build mode     : jse
>      [echo]                     Deploy Location: D:\java-ext\openjpa\openjpa-examples\openbooks/target/openbooks
>      [echo]
> check-env:
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] An Ant BuildException has occured: The following error occurred while executing
this line:
> D:\java-ext\openjpa\openjpa-examples\openbooks\build.xml:116: *** Error:
>                    The directory for OpenJPA libraries can not be located at d:/java/lib-maven2/repo/org/apache/openjpa/openjpa-all/2.2.0-SNAPSHOT.
>                    Make sure openjpa.lib property value is correct in
> Workaround:
> 1. add
>     <dependencies>
>       <dependency>
>         <groupId>org.apache.openjpa</groupId>
>         <artifactId>openjpa-all</artifactId>
>         <version>2.2.0-SNAPSHOT</version>
>       </dependency>
>     </dependencies>
> to openjpa-examples\pom.xml, run:
> 2. Fetch jar file using:
>   cd openjpa-examples
>   mvn dependency:tree
> 3. Return to root and compile:
>   cd ..
>   mvn compile

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message