openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] OpenJPA > Building
Date Wed, 09 Jun 2010 12:16:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/5/_/styles/combined.css?spaceKey=openjpa&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/openjpa/Building">Building</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~drwoods">Donald
Woods</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        add some common build failure scenarios<br />
    </div>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>\\ <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>h2. Common 2.0/2.1 Build Problems <br> <br>h3. Wrong Maven Level <br>
<br>Example Maven output - <br>{code:none} <br>[INFO] [enforcer:enforce
{execution: default}] <br>[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion
failed with message: <br>Detected Maven Version: 2.0.10 is not in the allowed range
[2.2.1,). <br>[INFO] ------------------------------------------------------------------------
<br>[ERROR] BUILD ERROR <br>[INFO] ------------------------------------------------------------------------
<br>[INFO] Some Enforcer rules have failed. Look above for specific messages explaining
why the rule failed. <br>{code} <br>Solution - Upgrade to Maven 2.2.1 or later
<br> <br>h3. Wrong Java Level <br> <br>Example Maven output - <br>{code:none}
<br>[INFO] [enforcer:enforce {execution: default}] <br>[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion
failed with message: <br>Detected JDK Version: 1.5.0-19 is not in the allowed range
[1.6,). <br>[INFO] ------------------------------------------------------------------------
<br>[ERROR] BUILD ERROR <br>[INFO] ------------------------------------------------------------------------
<br>[INFO] Some Enforcer rules have failed. Look above for specific messages explaining
why the rule failed. <br>{code} <br>Solution - Upgrade to latest Sun JDK 1.6.0
or IBM 6 SDK <br>Note - OpenJDK and Java SE 7 are not supported at this time. <br>
<br>h3. Missing License Headers <br> <br>Example Maven output - <br>{code:none}
<br>. . . <br>[INFO] ------------------------------------------------------------------------
<br>[INFO] Building OpenJPA Parent POM <br>[INFO]    task-segment: [clean, install]
<br>[INFO] ------------------------------------------------------------------------
<br>. . . <br>[INFO] [enforcer:enforce {execution: default}] <br>[INFO]
[source:test-jar {execution: attach-sources}] <br>[INFO] [ianal:verify-legal-files {execution:
default}] <br>[INFO] [apache-rat:check {execution: default}] <br>[INFO] Exclude:
**/javax.persistence.spi.PersistenceProvider <br>[INFO] Exclude: **/javax.annotation.processing.Processor
<br>[INFO] Exclude: **/*.rsrc <br>[INFO] Exclude: **/org.apache.openjpa.revision.properties
<br>[INFO] Exclude: scripts/*.list <br>[INFO] Exclude: scripts/*.options <br>[INFO]
Exclude: scripts/*.dict <br>[INFO] Exclude: **/.*/** <br>[INFO] Exclude: **/target/**/*
<br>[INFO] Exclude: **/dependency-reduced-pom.xml <br>[INFO] Exclude: **/*.log
<br>[INFO] Exclude: **/maven-eclipse.xml <br>[INFO] Exclude: **/rat.txt <br>[INFO]
Exclude: **/internal-repository/** <br>[INFO] ------------------------------------------------------------------------
<br>[ERROR] BUILD FAILURE <br>[INFO] ------------------------------------------------------------------------
<br>[INFO] Too many unapproved licenses: 1 <br>[INFO] ------------------------------------------------------------------------
<br>{code} <br>For the module that failed to build (which in the case above is
the root pom.xml) open the target/rat.txt file and search for any &quot;????&quot;
occurrences, like - <br>{code:none} <br>. . . <br>*****************************************************
<br>  Files with Apache License headers will be marked AL <br>  Binary files (which
do not require AL headers) will be marked B <br>  Compressed archives will be marked
A <br>  Notices, licenses etc will be marked N <br>  N     LICENSE.txt  N    
NOTICE.txt <br>  AL    openjpa/pom.xml  AL    openjpa/src/main/appended-resources/META-INF/LICENSE.vm
<br>  AL    openjpa/src/main/appended-resources/META-INF/NOTICE.vm <br> !?????
OPENJPA-1621.patch <br>. . . <br>{code} <br>Solution - either add the missing
ASL 2.0 license header, remove the file from your local working directory (if it is a temp
file that should not be added to svn), or ask on the dev@openjpa list if the file can be added
to the exclude list for the apache-rat checks. <br> <br> <br>\\ <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        

<h1><a name="Building-Contents"></a>Contents</h1>
<div>
<ul>
    <li><a href='#Building-Contents'>Contents</a></li>
    <li><a href='#Building-BuildingOpenJPA'>Building OpenJPA</a></li>
<ul>
    <li><a href='#Building-Maven'>Maven</a></li>
<ul>
    <li><a href='#Building-CommandLineBuilds'>Command Line Builds</a></li>
    <li><a href='#Building-ExecutingvariousMavenbuildtasks'>Executing various
Maven build tasks</a></li>
<ul>
    <li><a href='#Building-Runningjustthe%22TestPersistence%22testcase'>Running
just the "TestPersistence" test case</a></li>
    <li><a href='#Building-RunningtestswithJava2securityenabled'>Running tests
with Java 2 security enabled</a></li>
    <li><a href='#Building-Buildingandrunningonlytheexamplesincludedinthedistribution'>Building
and running only the examples included in the distribution</a></li>
    <li><a href='#Building-Buildingjustthejavadoc'>Building just the javadoc</a></li>
    <li><a href='#Building-Buildingjustthedocbookdocumentation'>Building just
the docbook documentation</a></li>
    <li><a href='#Building-BuildingwithJDK1.4moduleverification%28onlyforversionsofOpenJPApriortosvnrevision640685%29'>Building
with JDK 1.4 module verification (only for versions of OpenJPA prior to svn revision 640685)</a></li>
</ul>
</ul>
    <li><a href='#Building-EclipsewithCommandlineMavenutilities'>Eclipse with
Command-line Maven utilities</a></li>
    <li><a href='#Building-EclipsewithM2Eclipseplugin'>Eclipse with M2Eclipse
plugin</a></li>
    <li><a href='#Building-Common2.0%2F2.1BuildProblems'>Common 2.0/2.1 Build
Problems</a></li>
<ul>
    <li><a href='#Building-WrongMavenLevel'>Wrong Maven Level</a></li>
    <li><a href='#Building-WrongJavaLevel'>Wrong Java Level</a></li>
    <li><a href='#Building-MissingLicenseHeaders'>Missing License Headers</a></li>
</ul>
</ul>
</ul></div>

<h1><a name="Building-BuildingOpenJPA"></a>Building OpenJPA</h1>

<p>See <a href="/confluence/display/openjpa/Build+and+Runtime+Dependencies" title="Build
and Runtime Dependencies">Build and Runtime Dependencies</a> for details on the required
Java levels.</p>

<h2><a name="Building-Maven"></a>Maven</h2>

<h3><a name="Building-CommandLineBuilds"></a>Command Line Builds</h3>

<p>These instructions describe how to check out the current OpenJPA source code (from
the Subversion source code management repository) and build it (using the Apache Maven 2 build
tool). They are written for use from the console, and are known to work on Linux, Mac OSX
and Windows.</p>

<ol>
	<li>Ensure that you have Java installed and in your path by running: <tt>java
-fullversion</tt></li>
	<li>Install the build tool, Apache Maven 2.2.1 or later, from <a href="http://maven.apache.org/"
class="external-link" rel="nofollow">http://maven.apache.org/</a>. If it is installed
correctly, typing <tt>mvn -v</tt> from the console will result in text like <tt>Apache
Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)</tt></li>
	<li>Install Subversion v1.4.x or newer from <a href="http://subversion.apache.org/"
class="external-link" rel="nofollow">http://subversion.apache.org/</a>. If it is
installed correctly, typing the following command should output help information: <tt>svn
help</tt> or <tt>svn --version</tt></li>
	<li>Create a new directory you want to do your work in, then change to that directory
from the console.</li>
	<li>Check out the sources by running: <tt>svn co <a href="https://svn.apache.org/repos/asf/openjpa/trunk"
class="external-link" rel="nofollow">https://svn.apache.org/repos/asf/openjpa/trunk</a>
openjpa-trunk</tt>. It will check out the sources to the openjpa-trunk directory. More
information on checking out the OpenJPA sources can be found on the <a href="/confluence/display/openjpa/Source+Code"
title="Source Code">Source Code</a> page.</li>
	<li>Change to the openjpa-trunk directory, which has already been created in the previous
step.</li>
	<li>Build OpenJPA by running: <tt>mvn package</tt> or better <tt>mvn
install</tt>. The first time you run the build, many dependencies are automatically
resolved and downloaded. <b>It is common for dependency downloading to fail the first
time, which will fail the build.</b> If any of these dependency downloads fail, just
re-run the command. You may also add the following to your <tt>~/.m2/setting.xml</tt>
file (see <a href="http://maven.apache.org/guides/mini/guide-mirror-settings.html" class="external-link"
rel="nofollow">http://maven.apache.org/guides/mini/guide-mirror-settings.html</a>)</li>
</ol>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;settings&gt;</span>
    <span class="code-tag">&lt;mirrors&gt;</span>
        <span class="code-tag">&lt;mirror&gt;</span>
            <span class="code-tag">&lt;id&gt;</span>repo.mergere.com<span
class="code-tag">&lt;/id&gt;</span>
            <span class="code-tag">&lt;url&gt;</span>http://repo.mergere.com/maven2<span
class="code-tag">&lt;/url&gt;</span>
            <span class="code-tag">&lt;mirrorOf&gt;</span>central<span
class="code-tag">&lt;/mirrorOf&gt;</span>
        <span class="code-tag">&lt;/mirror&gt;</span>
    <span class="code-tag">&lt;/mirrors&gt;</span>
<span class="code-tag">&lt;/settings&gt;</span>
</pre>
</div></div>

<p> If any tests fail, and you want to ignore the failures, instead run:</p>

<p>  <tt>mvn package -DfailIfNoTests=false</tt></p>

<p> or</p>

<p>  <tt>mvn package -DskipTests</tt></p>


<p>An example session is as follows:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>$ cd /tmp/

$ java -version

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

$ mvn -v

Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0
Java home: /alt/sun160/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.18-1.2798.fc6" arch: "i386" Family: "unix"

$ svn --version

svn, version 1.4.3 (r23084)
   compiled Jan 18 2007, 07:47:40

$ svn co https://svn.apache.org/repos/asf/openjpa/trunk/

A  trunk/openjpa-lib
A  trunk/openjpa-lib/src
A  trunk/openjpa-lib/src/test
A  trunk/openjpa-lib/src/test/java
A  trunk/openjpa-lib/src/test/java/org
A  trunk/openjpa-lib/src/test/java/org/apache
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java

 ...

A  trunk/openjpa-persistence/pom.xml
Checked out revision 949178.

$ cd trunk/

$ mvn compile

[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   OpenJPA Parent POM
[INFO]   OpenJPA Utilities Library
[INFO]   OpenJPA Kernel
[INFO]   OpenJPA JDBC
[INFO]   OpenJPA Persistence
[INFO]   OpenJPA Persistence JDBC
[INFO]   OpenJPA Persistence Locking Tests
[INFO]   OpenJPA XML Store
[INFO]   OpenJPA Slice
[INFO]   OpenJPA Aggregate Jar
[INFO]   OpenJPA Aggregate Jar with Dependencies
[INFO]   OpenJPA Project Docs and Assemblies
[INFO]   OpenJPA Examples
[INFO]   OpenJPA Integration Tests
[INFO]   OpenJPA Integration Tests - Daytrader
[INFO]   OpenJPA Integration Tests - Examples
[INFO]   OpenJPA Integration Tests - JPA TCK
[INFO]   OpenJPA Integration Tests - Bean Validation
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenJPA Parent POM
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------

 ...

[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] OpenJPA Parent POM .................................... SUCCESS [4.114s]
[INFO] OpenJPA Utilities Library ............................. SUCCESS [6.684s]
[INFO] OpenJPA Kernel ........................................ SUCCESS [23.840s]
[INFO] OpenJPA JDBC .......................................... SUCCESS [20.248s]
[INFO] OpenJPA Persistence ................................... SUCCESS [8.421s]
[INFO] OpenJPA Persistence JDBC .............................. SUCCESS [12.656s]
[INFO] OpenJPA Persistence Locking Tests ..................... SUCCESS [0.243s]
[INFO] OpenJPA XML Store ..................................... SUCCESS [2.060s]
[INFO] OpenJPA Slice ......................................... SUCCESS [3.184s]
[INFO] OpenJPA Aggregate Jar ................................. SUCCESS [0.274s]
[INFO] OpenJPA Aggregate Jar with Dependencies ............... SUCCESS [0.105s]
[INFO] OpenJPA Project Docs and Assemblies ................... SUCCESS [0.293s]
[INFO] OpenJPA Examples ...................................... SUCCESS [1.896s]
[INFO] OpenJPA Integration Tests ............................. SUCCESS [0.055s]
[INFO] OpenJPA Integration Tests - Daytrader ................. SUCCESS [0.109s]
[INFO] OpenJPA Integration Tests - Examples .................. SUCCESS [0.628s]
[INFO] OpenJPA Integration Tests - JPA TCK ................... SUCCESS [0.053s]
[INFO] OpenJPA Integration Tests - Bean Validation ........... SUCCESS [0.272s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 27 seconds
[INFO] Finished at: Fri May 28 15:58:14 CEST 2010
[INFO] Final Memory: 46M/63M
[INFO] ------------------------------------------------------------------------

$ mvn package -DskipTests

[INFO] Scanning for projects...

...

[INFO] Building zip: /tmp/trunk/openjpa-project/target/site/downloads/apache-openjpa-2.1.0-SNAPSHOT-binary.zip

... 

$ ls -lh openjpa-project/target/site/downloads/

total 34M
-rw-r--r-- 1 milosz milosz 12M May 28 16:06 apache-openjpa-2.1.0-SNAPSHOT-binary.zip
-rw-r--r-- 1 milosz milosz 22M May 28 16:07 apache-openjpa-2.1.0-SNAPSHOT-source.zip

</pre>
</div></div>


<h3><a name="Building-ExecutingvariousMavenbuildtasks"></a>Executing various
Maven build tasks</h3>

<h5><a name="Building-Runningjustthe%22TestPersistence%22testcase"></a>Running
just the "TestPersistence" test case</h5>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn test -Dtest=TestPersistence
</pre>
</div></div>

<h5><a name="Building-RunningtestswithJava2securityenabled"></a>Running
tests with Java 2 security enabled</h5>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn test -Penable-security
</pre>
</div></div>

<h5><a name="Building-Buildingandrunningonlytheexamplesincludedinthedistribution"></a>Building
and running only the examples included in the distribution</h5>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn -DskipTests -Pexamples-profile integration-test
</pre>
</div></div>

<h5><a name="Building-Buildingjustthejavadoc"></a>Building just the javadoc</h5>

<p>First install the jars:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn install -DskipTests
</pre>
</div></div>

<p>Then build the javadoc:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn package -DskipTests -Pjavadoc-profile
</pre>
</div></div>

<p>The javadoc will be output to <tt>target/site/apidocs/index.html</tt>.</p>

<h5><a name="Building-Buildingjustthedocbookdocumentation"></a>Building
just the docbook documentation</h5>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>set MAVEN_OPTS=-Xmx512m
mvn -f openjpa-project/pom.xml process-resources -Pdocbook-profile
</pre>
</div></div>

<p>The manual HTML will be output to <tt>openjpa-project/target/manual/manual.html</tt>.</p>

<h5><a name="Building-BuildingwithJDK1.4moduleverification%28onlyforversionsofOpenJPApriortosvnrevision640685%29"></a>Building
with JDK 1.4 module verification (only for versions of OpenJPA prior to svn revision 640685)</h5>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn compile -Djava14.jar=C:\Program Files\Java\j2re1.4.2_07\lib\rt.jar compile
</pre>
</div></div>

<p>Specifying the "java14.jar" system property will cause the JDK-1.4-dependent modules
to be compiled with the value as the bootclasspath to the compiler. This can be useful to
ensure that modifications and additions do not violate the JDK version restriction of the
module. Since the runtime jar location is platform, version, and installation dependent, the
exact location of the runtime jar will vary, which is why it needs to be manually specified.</p>

<h2><a name="Building-EclipsewithCommandlineMavenutilities"></a>Eclipse
with Command-line Maven utilities</h2>

<ol>
	<li>Checkout the source as described above</li>
	<li>Build the source using Maven as described above</li>
	<li>Create the Eclipse Metadata - <br class="atl-forced-newline" />
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn eclipse:eclipse
</pre>
</div></div>
	<ul>
		<li>If this is the first project in your workspace to use maven artifacts you need
to create a classpath variable named M2_REPO which contains the full path to your local repository.
The eclipse plugin can do this for you with the following command <br class="atl-forced-newline"
/>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>mvn eclipse:configure-workspace -Declipse.workspace=${path to your workspace} 
</pre>
</div></div></li>
	</ul>
	</li>
	<li>Start Eclipse (3.2 - 3.4 SR2 are known to work) and create a new workspace</li>
	<li>Import the OpenJPA projects, by:
	<ul>
		<li>Select File --&gt; Import... --&gt; General - Existing Projects into Workspace
--&gt; Next</li>
		<li>Select root directory = &lt;svn checkout location above&gt;</li>
		<li>Deselect the openjpa-examples project</li>
		<li>Press Finish</li>
	</ul>
	</li>
	<li>A few fixups will be required to remove the errors that exist in the imported projects...
	<ul>
		<li>openjpa-kernel -&gt; Properties -&gt; Java Build Path -&gt; Source
-&gt; Add Folders
		<ul>
			<li>add target/generated-sources/javacc</li>
		</ul>
		</li>
		<li>openjpa-jdbc -&gt; Properties -&gt; Java Build Path -&gt; Libraries
-&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-persistence -&gt; Properties -&gt; Java Build Path -&gt; Libraries
-&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-persistence-jdbc -&gt; Properties -&gt; Java Build Path -&gt;
Libraries -&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-examples.  Open up src/main/java and select ReverseMapping folder.  Right
mouse click.
		<ul>
			<li>Select Build Path -&gt; Exclude</li>
		</ul>
		</li>
	</ul>
	</li>
	<li>For each imported project, you'll need to edit the build properties to remove an
incorrect dependency:
	<ul>
		<li>Project --&gt; Properties --&gt; Java Build Path --&gt; Source</li>
		<li>Remove openjpa-project from the list of source folders</li>
	</ul>
	</li>
</ol>


<p>For Java SE 5 users, you will need to exclude some Java SE 6 specific classes by
performing the following steps for the trunk source:</p>
<ol>
	<li>Open the Properties for openjpa-persistence</li>
	<li>Select Java Build Path --&gt; Source</li>
	<li>Edit the openjpa-persistence/src/main/java --&gt; Excluded setting to include
the following:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
org/apache/openjpa/persistence/meta/CompileTimeLogger.java
org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java
</pre>
</div></div></li>
</ol>


<h2><a name="Building-EclipsewithM2Eclipseplugin"></a>Eclipse with M2Eclipse
plugin</h2>

<ol>
	<li>Checkout the source as described above</li>
	<li>Build the source using Maven as described above</li>
	<li>Start Eclipse (3.5 Galileo is recommended) and create a new workspace</li>
	<li>Good references for this M2Eclipse plugin (need to install the plugin into your
Eclipse environment)
	<ul>
		<li><a href="http://m2eclipse.codehaus.org/" class="external-link" rel="nofollow">http://m2eclipse.codehaus.org/</a></li>
		<li><a href="http://docs.codehaus.org/display/M2ECLIPSE/Home" class="external-link"
rel="nofollow">http://docs.codehaus.org/display/M2ECLIPSE/Home</a></li>
		<li><a href="http://www.theserverside.com/tt/articles/article.tss?l=Introductiontom2eclipse"
class="external-link" rel="nofollow">http://www.theserverside.com/tt/articles/article.tss?l=Introductiontom2eclipse</a></li>
	</ul>
	</li>
	<li>Import the OpenJPA projects, by:
	<ul>
		<li>Select File --&gt; Import... --&gt; General -&gt; Maven Projects --&gt;
Next</li>
		<li>Select root directory = &lt;svn checkout location above&gt;</li>
		<li>All of the pom.xml files should be pre-selected for the svn checkout location</li>
		<li>You can affect the naming convention used for the generated Eclipse projects (one
for each Maven module).  Click on Advanced and fill in the Name Template field.  I prefer
"TRUNK-[artifactId]" since it helps with workspace organization, but it's your choice.</li>
		<li>Press Finish</li>
		<li><b>Note:</b>  You may get a popup internal error at the end of this
Import processing.  Not sure what the problem is, but it doesn't seem to affect the usage.
 This will probably get cleared up soon since Eclipse 3.5 is still quite new.</li>
	</ul>
	</li>
	<li>A few fixups will be required to remove the errors that exist in the imported projects...
	<ul>
		<li>openjpa-kernel -&gt; Properties -&gt; Java Build Path -&gt; Source
-&gt; Add Folders
		<ul>
			<li>add target/generated-sources/javacc</li>
		</ul>
		</li>
		<li>openjpa-jdbc -&gt; Properties -&gt; Java Build Path -&gt; Libraries
-&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-persistence -&gt; Properties -&gt; Java Build Path -&gt; Libraries
-&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-persistence-jdbc -&gt; Properties -&gt; Java Build Path -&gt;
Libraries -&gt; JRE System Library -&gt; Edit
		<ul>
			<li>change this to a Java 6 JRE to remove these errors (see below if you can not
use Java SE 6)</li>
		</ul>
		</li>
		<li>openjpa-examples.  Open up src/main/java and select ReverseMapping folder.  Right
mouse click.
		<ul>
			<li>Select Build Path -&gt; Exclude</li>
		</ul>
		</li>
	</ul>
	</li>
</ol>


<p>For Java SE 5 users, you will need to exclude some Java SE 6 specific classes by
performing the following steps for the trunk source:</p>
<ol>
	<li>Open the Properties for TRUNK-openjpa-persistence (or whatever your naming convention
is)</li>
	<li>Select Java Build Path --&gt; Source</li>
	<li>Edit the openjpa-persistence/src/main/java --&gt; Excluded setting to include
the following:
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>org/apache/openjpa/persistence/meta/AnnotationProcessor6.java
org/apache/openjpa/persistence/meta/CompileTimeLogger.java
org/apache/openjpa/persistence/meta/SourceAnnotationHandler.java
</pre>
</div></div></li>
</ol>


<p><br class="atl-forced-newline" /></p>

<h2><a name="Building-Common2.0%2F2.1BuildProblems"></a>Common 2.0/2.1 Build
Problems</h2>

<h3><a name="Building-WrongMavenLevel"></a>Wrong Maven Level</h3>

<p>Example Maven output -</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
[INFO] [enforcer:enforce {execution: default}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 2.0.10 is not in the allowed range [2.2.1,).
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Some Enforcer rules have failed. Look above for specific messages explaining why the
rule failed.
</pre>
</div></div>
<p>Solution - Upgrade to Maven 2.2.1 or later</p>

<h3><a name="Building-WrongJavaLevel"></a>Wrong Java Level</h3>

<p>Example Maven output -</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
[INFO] [enforcer:enforce {execution: default}]
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 1.5.0-19 is not in the allowed range [1.6,).
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Some Enforcer rules have failed. Look above for specific messages explaining why the
rule failed.
</pre>
</div></div>
<p>Solution - Upgrade to latest Sun JDK 1.6.0 or IBM 6 SDK<br/>
Note - OpenJDK and Java SE 7 are not supported at this time.</p>

<h3><a name="Building-MissingLicenseHeaders"></a>Missing License Headers</h3>

<p>Example Maven output -</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
. . .
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenJPA Parent POM
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
. . .
[INFO] [enforcer:enforce {execution: default}]
[INFO] [source:test-jar {execution: attach-sources}]
[INFO] [ianal:verify-legal-files {execution: default}]
[INFO] [apache-rat:check {execution: default}]
[INFO] Exclude: **/javax.persistence.spi.PersistenceProvider
[INFO] Exclude: **/javax.annotation.processing.Processor
[INFO] Exclude: **/*.rsrc
[INFO] Exclude: **/org.apache.openjpa.revision.properties
[INFO] Exclude: scripts/*.list
[INFO] Exclude: scripts/*.options
[INFO] Exclude: scripts/*.dict
[INFO] Exclude: **/.*/**
[INFO] Exclude: **/target/**/*
[INFO] Exclude: **/dependency-reduced-pom.xml
[INFO] Exclude: **/*.log
[INFO] Exclude: **/maven-eclipse.xml
[INFO] Exclude: **/rat.txt
[INFO] Exclude: **/internal-repository/**
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Too many unapproved licenses: 1
[INFO] ------------------------------------------------------------------------
</pre>
</div></div>
<p>For the module that failed to build (which in the case above is the root pom.xml)
open the target/rat.txt file and search for any "????" occurrences, like -</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
. . .
*****************************************************
  Files with Apache License headers will be marked AL
  Binary files (which do not require AL headers) will be marked B
  Compressed archives will be marked A
  Notices, licenses etc will be marked N
  N     LICENSE.txt  N     NOTICE.txt
  AL    openjpa/pom.xml  AL    openjpa/src/main/appended-resources/META-INF/LICENSE.vm
  AL    openjpa/src/main/appended-resources/META-INF/NOTICE.vm
 !????? OPENJPA-1621.patch
. . .
</pre>
</div></div>
<p>Solution - either add the missing ASL 2.0 license header, remove the file from your
local working directory (if it is a temp file that should not be added to svn), or ask on
the dev@openjpa list if the file can be added to the exclude list for the apache-rat checks.</p>


<p><br class="atl-forced-newline" /></p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/openjpa/Building">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23556&revisedVersion=43&originalVersion=42">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/openjpa/Building?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message