cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@apache.org>
Subject Starting cocoon application directly from eclipse
Date Tue, 06 Mar 2012 10:04:56 GMT
Hi,

We have been developing and running cocoon applications using 'mvn 
jetty:run'. We would like to stop that and run the project directly 
under eclipse.

In normal circumstances all you do is create a jetty-server dependency 
and run a simple class:

> public class Loader {
> 	public static void main( String[] args ) throws Exception {
> 		ToStringBuilder.setDefaultStyle( ToStringStyle.SHORT_PREFIX_STYLE );
>
> 		System.setProperty( "org.apache.cocoon.mode",
> 							"dev" );
>
> 		Server server = new Server();
> 		SocketConnector socketConnector = new SocketConnector();
> 		socketConnector.setPort( 80 );
> 		server.setConnectors( new Connector[]{ socketConnector } );
>
> 		WebAppContext context = new WebAppContext( "src/main/webapp", "/" );
> 		context.setClassLoader( Thread.currentThread().getContextClassLoader() );
>
> 		server.setHandler( context );
> 		server.setStopAtShutdown( true );
> 		server.start();
>
> 		server.join();
> 	}
> }

This web application uses two blocks. It seems that application starts 
correctly under eclipse under one very painful condition: the blocks 
have to be jars that cocoon block deployer will unpack.

The thing is: if you have: block1, block2, webapp as eclipse projects 
(maven enabled of course) there are two scenarios that dependencies are 
built:

   a) block1, block2: closed projects

      the projects need to be prebuilt and available in maven repository
      webapp uses block1.jar and block2.jar dependency
      cocoon application starts just fine.

   b) block1, block2: opened eclipse projects

      webapp uses block1, block2 exported classpaths directly. No
      dependency on jar. Cocoon block deployer is unable to properly
      initialize the application:


I assume the problem comes from the fact that cocoon block deployer 
unpacks jar dependencies looking for COB-INF folders.

Is there any way I can point cocoon block deployer to COB-INF folder 
directly on filesystem and run eclipse with all project open all the time?


   lg

Mime
View raw message