With Eclipse, RunJettyRun and m2eclipse I could just right click on a
project and select "Run Jetty". This would create a working run
configuration with the correct webapp, context and classpath. This was
useful because I could tell other members of my team to get a project from
SVN and right click to run it. They could then just add

-Dtapestry.execution-mode=DevelopmentMode

and make things even better. With Gradle things are not quite as smooth but
I think if the following were added to org.apache.tapestry5.test.Jetty7Runner
it might even be better.

*public* *static* *void* main(String[] args) *throws* Exception{

String webapp = System.getProperty("webapp") == *null* ?
"src/main/webapp": System.getProperty(
"webapp");

String context = System.getProperty("context") == *null* ? "/" :
System.getProperty("context");

String httpPort = System.getProperty("httpPort") == *null* ? "8080" :
System.getProperty("httpPort");

String sslPort = System.getProperty("sslPort") == *null* ? "8443" :
System.getProperty("sslPort");

 *new* Jetty7Runner(webapp,context,*new* Integer(httpPort),
*new*Integer(sslPort));

    }


because you no longer need a plugin to run Jetty. From what Dmitry posted
it appears you can write a Gradle job to create the run task but I'm
guessing this would also be possible with his fancy Eclipse plugin.




On Fri, Sep 6, 2013 at 9:09 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 06 Sep 2013 10:28:04 -0300, Barry Books <trs...@gmail.com> wrote:
>
>  Thanks, I guess I was not clear what I meant by works. RunJettyRun knows
>> about Maven
>>
>
> It says so, but I cannot really see what it does (besides configuring
> src/main/webapp as the webapp context root automatically).
>
>
>  so I can just right click on my project select "Run Jetty" and it 'just
>> works'. No messing with classpaths, creating a run configuration
>> etc.
>>
>
> With Maven you still need to create a run configuration. The classpath
> configuration part (webapp classpath tab), as far as I know, it's just
> taken from the project configuration in Eclipse as is.
>
>
> If you can do that with Eclipse/Gradle I'd like to know how because
>
>> when I try it Tapestry does not start and if I go to the website I get
>> this:
>>
>> Directory: /sandbox/META-INF/  
>> <http://localhost:8080/**sandbox/META-INF/<http://localhost:8080/sandbox/META-INF/>
>> >102
>>
>> bytes Sep 5, 2013 7:13:00 AMWEB-INF/
>> <http://localhost:8080/**sandbox/WEB-INF/<http://localhost:8080/sandbox/WEB-INF/>
>> >136
>>
>> bytes Sep 5, 2013 7:13:19 AM
>>
>
> That's because you probably didn't set the webapp context root folder
> and/or didn't configure the classpath.
>
>  It did occur to me that the test case runner is now its own module so I
>> tried this:
>>
>> *import* org.apache.tapestry5.test.**Jetty7Runner;
>>
>>
>> *public* *class* Jetty {
>>
>> *public* *static* *void* main(String[] args) *throws* Exception{
>>
>> Jetty7Runner runner =  *new* Jetty7Runner("src/main/webapp"**
>> ,"/",8080,8443);
>>
>>
>>     }
>>
>> }
>>
>>
>> and that works if I add src/main/resources to the classpath and check
>> exported entries only.
>>
>
> src/main/resources should be part of the classpath in a way or another
> (directly or through adding the folder to which classes are compiled.
>
>
>  This may even be better because I don't need a
>> plugin but still does not fit my definition of 'just works'. I would rate
>> it promising.
>>
>
> Running an embedded Jetty instance, for me, is the best option after
> RunJettyRun.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org>
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to