cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Puerto <jpue...@gmail.com>
Subject Re: Starting cocoon application directly from eclipse
Date Tue, 06 Mar 2012 11:50:27 GMT
Hi Leszek

2012/3/6 Leszek Gawron <lgawron@apache.org>

> 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.
>

Did you tested to run the application directly with maven plugin and goal
jetty:run? We are working with a similar case and we use this approach.


>
> 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