Re: [Chiba-users] chiba-web & cocoon 2.2 (with Maven)
Creators discontinued Chiba & founded betterFORM http://betterform.de
Brought to you by:
chibaxforms,
windauer
From: anil <ani...@bt...> - 2007-12-19 13:16:11
|
Hi Lars - Firstly, many thanks for your kind reply. Your response seems eminently sensible, although I've had a couple of problems which I thought I would document to try and help anyone else trying to do a similar thing, and also to see if you had any ideas on a resolution. Basically I followed your advice and checked out the latest chiba-web trunk through my svn eclipse plugin (I think detached the project I created so as not to inadvertantly check anything in by mistake!). I then ran mvn install on the command line, which unfortunately yielded some problems. Running the mvn install command with -X to get some debugging information out I found the following issue: [DEBUG] ant-contrib:ant-contrib:jar:1.0b2:runtime (selected for runtime) [DEBUG] ant:ant:jar:1.6.5:runtime (removed - nearer found: 1.5) [DEBUG] ant:ant:jar:1.5:runtime (selected for runtime) [DEBUG] org.apache.ant:ant-trax:jar:1.7.0:runtime (selected for runtime) [DEBUG] org.apache.ant:ant:jar:1.7.0:runtime (selected for runtime) [DEBUG] org.apache.ant:ant-launcher:jar:1.7.0:runtime (selected for runtime) [DEBUG] Configuring mojo 'chiba:dep:1.0-SNAPSHOT:war' --> [DEBUG] -- end configuration -- [INFO] [dep:war {execution: default}] [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] org.apache.tools.ant.util.FileUtils.getFileUtils()Lorg/apache/tools/ant/util/FileUtils; [INFO] ------------------------------------------------------------------------ [DEBUG] Trace java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.getFileUtils()Lorg/apache/tools/ant/util/FileUtils; at org.apache.tools.ant.taskdefs.Get.<clinit>(Get.java:48) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.apache.tools.ant.Project.init(Project.java:269) at org.codehaus.plexus.component.factory.ant.AntScriptInvoker.initializeProject(AntScriptInvoker.java:251) at org.codehaus.plexus.component.factory.ant.AntScriptInvoker.invoke(AntScriptInvoker.java:174) at org.apache.maven.script.ant.AntMojoWrapper.execute(AntMojoWrapper.java:52) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126) at org.apache.maven.cli.MavenCli.main(MavenCli.java:282) 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:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10 seconds [INFO] Finished at: Wed Dec 19 12:59:46 GMT 2007 [INFO] Final Memory: 11M/21M [INFO] ------------------------------------------------------------------------ As you can see mvn complains that a method doesn't exist within ant - the getFileUtils() method - I've tried to highlight within the debug information what I think the problem is, and that is that mvn seems to be overriding the use of ant 1.6.5 for the version 1.5. Checking the API docs for ant seems to indicate that the method doesn't exist in ant distribution 1.5.2 (I couldn't find api docs for 1.5), but that getFileUtils should be available from 1.6.3. I tried to override the use of ant-1.5.jar by adding a dependency into the main chiba-web pom.xml to use ant 1.6.5, but that didn't seem to have any effect. Looking at the plugin pom.xml there are 3 dependencies within this - maven-ant-script (version 2.0.7), ant-trax-1.7.0 & ant-contrib-1.0b2. I was wondering whether you had encountered any of these problems when checking out the latest chiba-web & building the war? If you do have any advice if you could pass it on I'd be very grateful. As a next step I think I'll download the plugin, modify the pom.xml to introduce a dependency to ant 1.6.5, add the new plugin to my local repository and try a mvn install again. As a slight side issue, I also tried running mvn install from within my eclipse plugin and got a different error message, which was: [INFO] ---------------------------------------------------------------------------- [INFO] Building Chiba Web [INFO] task-segment: [install] [INFO] ---------------------------------------------------------------------------- [INFO] ---------------------------------------------------------------------------- [ERROR] BUILD FAILURE [INFO] ---------------------------------------------------------------------------- [INFO] The PluginDescriptor for the plugin chiba:dep was not found [INFO] ---------------------------------------------------------------------------- I don't know whether you have encountered this before? Anyway, once again many thanks for your advice. I'll be sure to add to this post if I manage to get any further - hopefully my ramblings will be of some use to someone else if I manage to get it solved. Many thanks, Anil. Lars Windauer wrote: > > Anil, > > You have to include all libs Chiba depends on to make step 4 work. You > can see which libs you are missing by taking a look into WEB-INF/lib of > a deployed chiba-web. > > I would recommend you to get an actual Chiba Web from the Subversion > repository (https://chibaxforms.org/svn/repos/trunk/chiba-web/) since > this uses Maven too. Call 'mvn install' within the project folder to > deploy chiba-web-2.2.0.war and all depended libs to your local > repository. You can then use the maven-war-plugin within your pom.xml to > merge the two webapps. > > <project> > ... > <artifactId>yourWARProject</artifactId> > <type>war</type> > > <build> > <plugin> > <artifactId>maven-war-plugin</artifactId> > <configuration> > <workDirectory>${basedir}</workDirectory> > <overlays> > <overlay> > <groupId>org.chiba</groupId> > <artifactId>chiba-web</artifactId> > <excludes> > <exclude>forms/apps</exclude> > </excludes> > </overlay> > </overlays> > </configuration> > </plugin> > .. > </build> > <dependencies> > <dependency> > <groupId>org.chiba</groupId> > <artifactId>chiba-web</artifactId> > <version>2.2.0</version> > <type>war</type> > </dependency> > <dependencies> > .. > > In this configuration you would only need to execute step 1 and 2 as you > described (possibly even this can be automated) and everything else is > done by Maven by calling mvn war:war. > > If you need to extend Java classes of Chiba you simply add the required > dependencies with a provided scope to your pom.xml > > <dependency> > <groupId>org.chiba</groupId> > <artifactId>chiba</artifactId> > <version>1.4.0</version> > <type>jar</type> > <scope>provided</scope> > </dependency> > > <!-- to enable this dependency mvn war:war must be called before any > other maven goal! This might change in the near future --> > <dependency> > <groupId>org.chiba</groupId> > <artifactId>chiba-web</artifactId> > <version>2.2.0</version> > <scope>system</scope> > > <systemPath>${basedir}/org.chiba/chiba-web/WEB-INF/lib/chiba-web-2.2.0.jar</systemPath> > </dependency> > > > Hth, and it would be nice if you keep us posted about your progress > > lars > > > > anil schrieb: >> >> Hi - >> >> I've been using chiba a little recently and had some success integrating >> chiba-web into cocoon 2.1. >> >> I'm now trying to integrate chiba-web into cocoon 2.2 with it's new maven >> structure and I was wondering if anyone had had any success with this, as >> I >> am having a few problems. I have to admit that my maven knowledge is >> simply >> what I have gained whilst using cocoon 2.2 so it's not a lot. >> >> What I have done so far is: >> >> (1) merge the chiba-web.xml settings into my web.xml for cocoon >> >> (2) add chiba-log4j-defaults.xml & chiba-config-defaults.xml to the >> src/main/webapp/WEB-INF dir >> >> (3) copy the chiba resources dir (containing images, jsp, scripts etc) >> within src/main/webapp >> >> Now what I think I need to do is: >> >> (4) Somehow get the chiba-1.3.0.jar & chiba-web-2.1.0.jar into the maven >> dependencies >> >> It's step 4 I'm having trouble with I think! Is there a maven repository >> containing the chiba jars & can I simply add these as a dependency within >> the cocoon webapp pom.xml? Or would I be right to add these by hand to >> the >> local repository I have? >> >> If anyone's managed this integration could they please confirm that this >> is >> the right approach & if it's not then please let me know where I've gone >> wrong. >> >> Many thanks in advance, >> Anil. >> >> > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Chiba-users mailing list > Chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiba-users > > -- View this message in context: http://www.nabble.com/chiba-web---cocoon-2.2-%28with-Maven%29-tp14399836p14416775.html Sent from the chiba-users mailing list archive at Nabble.com. |