openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Building in Eclipse
Date Mon, 18 May 2009 18:13:01 GMT

Hi Alan,
  I build/debug OpenJPA in Eclipse in a somewhat non-kosher way. The
complexity arises because OpenJPA is a multi-module project and requires
some javaCC generated source code.
 So I am not prescribing the steps but purely describing what works for me.

  1. checkout openjpa source code to say a directory X. You can check the
project out from Eclipse itself too. Then ignore Step 3.
  2. compile with maven -- this will create javacc generated source code
which is required for next steps.
Also it will fetch the dependent libraries in local maven repository.
  3. create an Eclipse project with root directory X
  4. add a whole bunch of 'source folders' to the Eclipse project (see
attached .classpath and .project
files). The output for each of these 'source folders' are different and
should match maven target directory to keep maven and Eclipse build in
synch.
  5. Define a bunch of 'User Libraries' and attach the corresponding jar
that Step 2 has placed in local maven repository. 

  Now the Eclipse project can be cleaned and built with 3 errors about
javaCC generated code. I still could not get rid of them -- but they seemed
to be harmless enough for me so far.

=============== .project file ======================================
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>trunk</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
</projectDescription>

============== .classpath file ==========================================
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" output="openjpa-lib/target/classes"
path="openjpa-lib/src/main/java"/>
	<classpathentry kind="src" output="openjpa-jdbc/target/test-classes"
path="openjpa-jdbc/src/test/java"/>
	<classpathentry kind="src" output="openjpa-kernel/target/classes"
path="openjpa-kernel/target/generated-sources/jjtree"/>
	<classpathentry kind="src" output="openjpa-kernel/target/classes"
path="openjpa-kernel/target/generated-sources/javacc"/>
	<classpathentry kind="src" output="openjpa-lib/target/test-classes"
path="openjpa-lib/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src"
output="openjpa-lib/src/main/resources"
path="openjpa-lib/src/main/resources"/>
	<classpathentry excluding="**" kind="src" output="openjpa-project"
path="openjpa-project"/>
	<classpathentry excluding="**" kind="src"
output="openjpa-lib/src/test/resources"
path="openjpa-lib/src/test/resources"/>
	<classpathentry kind="src" output="openjpa-kernel/target/classes"
path="openjpa-kernel/src/main/java"/>
	<classpathentry kind="src" output="openjpa-kernel/target/test-classes"
path="openjpa-kernel/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src"
output="openjpa-kernel/src/main/resources"
path="openjpa-kernel/src/main/resources"/>
	<classpathentry kind="src" output="openjpa-jdbc/target/classes"
path="openjpa-jdbc/src/main/java"/>
	<classpathentry excluding="**" kind="src"
output="openjpa-jdbc/src/main/resources"
path="openjpa-jdbc/src/main/resources"/>
	<classpathentry kind="src" output="openjpa-persistence/target/classes"
path="openjpa-persistence/src/main/java"/>
	<classpathentry kind="src" output="openjpa-persistence/target/test-classes"
path="openjpa-persistence/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src"
output="openjpa-persistence/target/classes"
path="openjpa-persistence/src/main/resources"/>
	<classpathentry kind="src" output="openjpa-persistence-jdbc/target/classes"
path="openjpa-persistence-jdbc/src/main/java"/>
	<classpathentry kind="src"
output="openjpa-persistence-jdbc/target/test-classes"
path="openjpa-persistence-jdbc/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src"
output="openjpa-persistence-jdbc/src/main/resources"
path="openjpa-persistence-jdbc/src/main/resources"/>
	<classpathentry excluding="**" kind="src"
output="openjpa-persistence-jdbc/src/test/resources"
path="openjpa-persistence-jdbc/src/test/resources"/>
	<classpathentry kind="src" output="openjpa-xmlstore/target/classes"
path="openjpa-xmlstore/src/main/java"/>
	<classpathentry kind="src" output="openjpa-slice/target/classes"
path="openjpa-slice/src/main/java"/>
	<classpathentry kind="src" output="openjpa-slice/target/test-classes"
path="openjpa-slice/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry excluding="**" kind="src"
output="openjpa-slice/src/main/resources"
path="openjpa-slice/src/main/resources"/>
	<classpathentry excluding="**" kind="src"
output="openjpa-slice/src/test/resources"
path="openjpa-slice/src/test/resources"/>
	<classpathentry excluding="reversemapping/*.java" kind="src"
output="openjpa-examples/target/classes"
path="openjpa-examples/src/main/java"/>
	<classpathentry kind="src" output="openjpa-examples/target/test-classes"
path="openjpa-examples/src/test/java">
		<attributes>
			<attribute name="maven.type" value="test"/>
		</attributes>
	</classpathentry>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/APACHE_ANT"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/COMMONS_COLL"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/COMMONS_LANG"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/COMMONS_LOG"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/COMMONS_POOL"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/HSQLDB"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/JMS"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/JPA_2.0_PD"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/JTA"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/LOG4J"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/POSTGRES"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/REGEX"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/SERP_1.13.1"/>
	<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.USER_LIBRARY/UOW"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

 


Alan Raison wrote:
> 
> Hi
> 
> Does anyone have any experience (preferably successful) of building
> openjpa-kernel in Eclipse?
> 
> I've found that checking out each sub-project from trunk usually works
> fine when building against a released version (as then I can download
> the pre-compiled openjpa-kernel from the maven repo) but this doesn't
> work so well when working with trunk.
> 
> Working from the command line is fine but a bit limited in Windows -
> especially when trying to patch the source!
> 
> My specific issue is that Eclipse complains of compile errors in the
> (src/main/java/)org.apache.openjpa.kernel.jpql package as these files
> depend on the jjtree sources.  If I add target/generated-sources/javacc
> to the build path I get a name clash with the SimpleNode class in both
> the src/main/java and target/generated-sources/javacc folders.  I also
> tried adding the target/generated-sources/jjtree folder in place of the
> target/generated-sources/javacc folder but this didn't work either.
> 
> Sorry if I am being thick with this.  I need my IDE!! ;)
> 
> Alan
> 
> 
> 


-----
Pinaki Poddar                      http://ppoddar.blogspot.com/
                                      
http://www.linkedin.com/in/pinakipoddar
OpenJPA PMC Member/Committer
JPA Expert Group Member
-- 
View this message in context: http://n2.nabble.com/Building-in-Eclipse-tp2934132p2934719.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message