Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Static weaving question: referenced jars?

Only Fred would be weaved.


ljnelson wrote:
> 
> I had a look through the static weaving source code, but had to give up
> (not
> enough time).
> 
> I'm looking at doing some JPA unit testing "the right way".  Currently we
> do
> it the wrong way by explicitly disabling weaving altogether (otherwise the
> Big Three JPA providers crash into each other in our unit tests with their
> dynamic weaving/enhancement agents).
> 
> By "the right way" I mean performing static weaving (in EclipseLink's
> case).
> 
> As I was whacking away at the various Maven incantations to make this all
> happen during JUnit execution, it dawned on me: I can statically weave the
> *current* project's JPA classes, but what (if anything) will the weaver do
> about classes referenced in the persistence unit that are (a) on the
> classpath, and hence at least somewhat visible to the static weaver but
> (b)
> not in the (single?!) jar/directory specified as the static weaver's
> "source" argument?
> 
> To put it more simply: assume I'm working on a classes directory for
> project
> Fred.
> 
> Assume further that Fred has a dependency on Joe.  Joe is a project
> containing unweaved entity classes in a jar, and is on the classpath at
> the
> time that the static weaver is called.
> 
> If I call the weaver like this:
> 
>   java org.eclipse.persistence.tools.weaving.jpa.StaticWeave
> -persistenceinfo c:\wherever -classpath c:\fred\classes;c:\joe.jar
> c:\fred\classes c:\fred\weaved-classes
> 
> ...I'm assuming it will only weave Fred's classes, not Joe's, even if
> Fred's
> persistence XML makes reference to a Joe class.
> 
> Is there a way (I don't see one) to specify multiple source jars?
> 
> (Finally, the -classpath argument, incidentally is *not* required,
> contrary
> to the documentation; obviously in such a case you'd better be invoking
> StaticWeave from within a Java program)
> 
> Best,
> Laird
> 
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Static-weaving-question%3A-referenced-jars--tp31052446p31107205.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top