|
|
|
Re: Static Weaving through Eclipse Plug-in [message #538564 is a reply to message #538313] |
Tue, 08 June 2010 00:57 |
Ari Meyer Messages: 136 Registered: July 2009 |
Senior Member |
|
|
Hi Marco,
I use Maven and Eclipse (and the Maven Eclipse plugin) as well. I set
up a launch config in Eclipse to execute static weaving on demand, and
here it is as exported:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/***PROJECT***"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.eclipse.persistence.tools.weaving.jpa.StaticWeave "/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="-loglevel FINEST -persistenceinfo src/main/resources
target/classes target/classes"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="***PROJECT***"/>
</launchConfiguration>
You can replace the "***PROJECT***" placeholders with your Eclipse
project name and then import that launch config, if you'd like. Notice
the MAIN_TYPE and PROGRAM_ARGUMENTS. As long as the eclipselink JAR is
in your Build Path, this should work for you.
Also, here's the relevant part of my Maven config (including an
alternate, commented-out version):
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>JPA Enhancement</id>
<phase>process-classes</phase>
<configuration>
<tasks>
<taskdef
name="weave"
classname=" org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask "
classpathref="maven.test.classpath"/>
<weave
loglevel="FINEST"
source="${basedir}/target/classes"
target="${basedir}/target/classes"
persistenceinfo="${basedir}/src/main/resources">
<classpath refid="maven.test.classpath"/>
</weave>
<!--
<java
classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeave "
classpathref="maven.test.classpath"
fork="true">
<arg
line="-loglevel FINEST -persistenceinfo
src/main/resources target/classes target/classes"/>
</java>
-->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
and here's where I originally got it from:
http://www.tzavellas.com/techblog/2008/10/17/statically-weav ing-jpa-entities-for-eclipselink-using-maven/
Best regards,
Ari
marco wrote:
> Hi Shaun,
>
> first of all thanks for your answer. Indeed, dynamic weaving is the
> preferable option - however, not applicable for JUnit Testing as well as
> deployments to Tomcat (which is our current deployment target).
> I played around with integrating the ant task in our Eclipse build, but
> with limited success. This may be due to our "special" dev config. We
> use Maven (and the Maven Eclipsep plug-in) for dependency management as
> well as for packaging the application. Regular builds during development
> are done in Eclipse. However, due to using Maven our dependencies are
> kept outside from the application path during development (in the maven
> user repo). Using the ant task I experienced that these dependencies
> cannot be accessed without setting an absolute classpath for every
> developer (or duplicating the jars within the application path).
> Therefore, I stopped investigating a solution relying on the Ant task.
> If there is an option to do so, I would appreciate any hints.
> In the meantime I will file an RFE for Dali as you proposed.
>
> Thanks, marco
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04026 seconds