You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jean-François El Fouly <je...@elfouly.nom.fr> on 2004/05/07 12:35:53 UTC

Is it possible to build WAR and EAR in the same project ?

Suppose I have a project with a web application. At the moment, I build the 
war in this project and the ear in another project that basically has just 
a POM, a maven.xml and build.properties.
Though it seems that the ear plugin was designed to build in the web 
application project itself rather than in another project (since it copies 
the built EAR in application/ears/application-version.ear.

On the other hand, if I want to build the EAR in the same project, I need 
to include the application war as a dependency, so I have some kind of 
chicken-and-egg problem (BTW it became even more difficult since wars now 
have versions).

Did I miss any obvious recipe ?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Is it possible to build WAR and EAR in the same project ?

Posted by Edgar González <eg...@valhallaproject.com>.
Jean-François,

I did this with a custom goal, something like this:

    <goal name="myEar">
        <attainGoal name="war"/>
        <copy todir="target/ear" overwrite="yes">
            <fileset dir="src/application" />
            <fileset dir="target" includes="*.war" />
        </copy>
        <attainGoal name="ear"/>
    </goal>

And 

maven.ear.src=target/ear

Hope this help

----------------------------------------------------------------------
------
Edgar González González
VALHALLA Project, s.a.
Chief Technology Officer
Web: www.valhallaproject.com
E-mail: egg@valhallaproject.com / egg@cantv.net
Phone: +58-212-242.4379 / 6662 / 4055 / 6475
Fax: +58-212-242.6809 
"The limits of my language mean the limits of my world."
Ludwig Wittgenstein 
----------------------------------------------------------------------
------ 
Jean-François El Fouly <je...@elfouly.nom.fr> wrote:
(05/07/2004 06:35)

>Suppose I have a project with a web application. At the moment, I build the 
>war in this project and the ear in another project that basically has just 
>a POM, a maven.xml and build.properties.
>Though it seems that the ear plugin was designed to build in the web 
>application project itself rather than in another project (since it copies 
>the built EAR in application/ears/application-version.ear.
>
>On the other hand, if I want to build the EAR in the same project, I need 
>to include the application war as a dependency, so I have some kind of 
>chicken-and-egg problem (BTW it became even more difficult since wars now 
>have versions).
>
>Did I miss any obvious recipe ?
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


hibernate:schema-export failing?

Posted by "J. Matthew Pryor" <jm...@yahoo.com>.
I am trying to use the hibernate plugin with maven RC1 & JDK 1.4.1

What is strange is that the bottom of the stack trace appear t be caused by
java.lang.NoClassDefFoundError: net/sf/cglib/reflect/FastClass

However net.sf.cglib.reflect.FastClass can clearly be seen high up in the
stack trace, so I am a bit confused as to what is really gong on here

Anyone got any hints on further diagnosis?

Thanks,
Matthew

hibernate:schema-export:
    [echo] Exporting Hibernate Schema file
    [mkdir] Created dir: C:\herbivore\modules\web-ui\target\schema
file:/C:/herbivore/modules/web-ui/target/classes/
Excludes:
Includes:**/*.hbm.xml
Base dir:C:\herbivore\modules\web-ui/target/classes

BUILD FAILED
net.sf.hibernate.MappingException:
net.sf.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->nul
        at
net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:176)
        at
org.apache.maven.hibernate.beans.SchemaExportBean.getConfiguration(SchemaExp
ortBean.java:319)
        at
org.apache.maven.hibernate.beans.SchemaExportBean.execute(SchemaExportBean.j
ava:246)
        at
org.apache.maven.hibernate.jelly.SchemaExportTag.execute(SchemaExportTag.jav
a:45)
        at
org.apache.maven.hibernate.jelly.SchemaExportTag.doTag(SchemaExportTag.java:
60)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
        at org.apache.maven.cli.App.doMain(App.java:543)
        at org.apache.maven.cli.App.main(App.java:1109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: net.sf.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->null
        at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:
206)
        at
net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:92)
        at net.sf.cglib.reflect.FastClass.create(FastClass.java:74)
        at
net.sf.hibernate.type.ComponentType.<init>(ComponentType.java:113)
        at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:899)
        at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1041)
        at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:361)
        at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
        at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
        at
net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
        ... 20 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:406)
        at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:
193)
        ... 29 more
Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/reflect/FastClass
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
        ... 35 more
File...... file:/C:/dev/maven/plugins/maven-hibernate-plugin-1.0/
Element... h:schema-export
Line...... 46
Column.... 53
net.sf.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->null
Total time: 15 seconds
Finished at: Sat May 08 01:03:15 EST 2004

C:\proj\main\apps\herbivore\modules\web-ui>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org