Ooh, I hope that works!  Though I'll be kicking myself if that's all it was. 
;)  I didn't use "provided" because I thought that means the jars won't be
automatically downloaded from the Maven repo if the user doesn't have them. 
Is that not the case?  

Thanks,
Polly


Patrik Nordwall wrote:
> 
> Hi Polly,
> Have you tried scope provided?
> 
>               <dependency>
>                       <groupId>org.fornax.cartridges</groupId>
>                       
> <artifactId>fornax-cartridges-sculptor-generator</artifactId>
>                       <version>${sculptor.version}</version>
>                       <scope>provided</scope>
>               </dependency>
> 
> That is how the archetypes generate the pom files and that is how I use it
> without any further excludes, and it is not placed in war/ear.
> 
> /Patrik
> 
> 
> 
> polly.c.chang wrote:
>> 
>> Hi,
>> 
>> I've wondered about this problem for a while now, and I cannot figure out
>> a way to solve this.  
>> 
>> To generate code in my user project, the user project has to declare a
>> dependency to the "generator" jar, which transitively brings in
>> dependencies like the "metamodel" and "dsl" jars and EMF, oAW,
>> HybridLabs, Jalopy, Antlr, etc.  There are a whole bunch of jars that
>> come in via transitive dependencies.  The problem is that these jars are
>> always on the classpath.  So when I create wars or other projects depend
>> on my project, these jars always go with them.  Yes, there are usually
>> ways to exclude these jars in each of those scenarios, but I have to hunt
>> down every usage and put the fix there.  It would be nice if there was a
>> way for these jars to be available only when we generate code.  Because
>> after that happens, they are not used anymore.
>> 
>> I tried changing the scope of the dependencies or making them optional,
>> but then I get ClassNotFoundExceptions when I try to generate.  So it
>> seems that most of the jars are required for generation.  It would be too
>> much work (and error-prone) to figure out exactly which ones are really
>> needed at runtime.  Plus it doesn't really solve the problem.
>> 
>> I also tried defining the dependency to the "generator" jar in the
>> "fornax-oaw-m2-plugin" plugin "dependency" section instead of directly in
>> my user project.  I figured that this seems logical.  The "generator" is
>> needed only by the plugin when it runs.  But alas, that does not work
>> either.  There are no errors, but nothing generates.  I get:
>> 
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] :
>> --------------------------------------------------------------------------------------
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] : openArchitectureWare
>> v4.3.1
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] : (c) 2005-2008
>> openarchitectureware.org and contributors
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] :
>> --------------------------------------------------------------------------------------
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] : running workflow:
>> workflow.oaw
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] : 
>> [org.fornax.toolsupport.maven2.MojoWorkflowRunner] : workflow completed
>> in 0ms!
>> 
>> Can someone tell me why this approach doesn't work and how I might get it
>> to work?
>> 
>> If this approach won't work, how can I get the "generator" and its
>> transitive dependencies off my user project's classpath?
>> 
>> Thanks!
>> --Polly
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-Sculptor--Generator-dependency-tp26309409s17564p26322073.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to