You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by LutherBaker <lu...@gmail.com> on 2010/08/24 17:34:53 UTC

Optimal Development Cycle

My question is about just general workflow development. I'm having a hard
time changing files and having Jetty pick up the changes without a manual
restart and I'm sure I must be missing something.

Assuming Netbeans, I've created a maven project, included the Click
dependencies and invoked jetty via maven command "jetty:run". Jetty starts
up just fine and all the "quickstart guide" pages show up. If I change text
on a page, I don't see the changes unless I shutdown and restart jetty. The
same goes for IntelliJ - changing the *htm files isn't visible without a
restart. I also changed and saved the Home page class file - still, no
restart or change in page appearance.

I fired up Eclipse and imported the same Maven project and it did not detect
changes to the htm files ... but it DID detect changes to the class file -
after which, it restarted and the page was reloaded.

My jetty plugin config includes <scanIntervalSeconds>:

            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.10</version>
                <configuration>
                    <scanIntervalSeconds>4</scanIntervalSeconds>
                    <stopKey>foo</stopKey>
                    <stopPort>9999</stopPort>
                    <webAppConfig>
                        <contextPath>/projx</contextPath>
                        <tempDirectory>src/main/webapp</tempDirectory>
                       
<defaultsDescriptor>src/main/config/jetty/webdefault.xml</defaultsDescriptor>
                    </webAppConfig>
                   
<jettyConfig>src/main/config/jetty/jetty.xml</jettyConfig>
                    <connectors>
                        <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>9090</port>
                            <maxIdleTime>60000</maxIdleTime>
                        </connector>
                    </connectors>
                </configuration>
            </plugin>

Is there some suggested workflow best practice? Which IDE works best out of
the box ... and what is the best way to build/work on a project - use the
native WTP and download all the JARS? or can I leverage maven ... or is
there a hybrid approach that I am missing.

Also, if this is velocity, is it possible that Velocity will cache these
files? Is there a parameter I can supply that forces velocity not to do
this? I was surprised that Eclipse detected changes to the classpath files -
but not maven's webapp directory.

Thanks in advance for any suggestions (looking for solutions other than
zeroturnaround ... but if that is required ....)

-Luther

-- 
View this message in context: http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5457365.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Optimal Development Cycle

Posted by LutherBaker <lu...@gmail.com>.
I have the free copy of IntelliJ 9 and I'm not sure where to set the
'exploded' directory.

I have a paid copy of IntelliJ 8 which has Tomcat builtin. The internal
Tomcat server indeed has several options, one of which is a deployment web
facet and Exploded Directory input field. After following the directions 
http://mattfleming.com/node/281 here  (which includes setting the exploded
directory), I got it to work - but not without an interesting note. It seems
that I must click the 'MAKE PROJECT' button (just to the left of the Run
menu) after changing a file. Is that correct or is there a way to automate
this? Maybe that's expected and allows me to batch changes ... although it
is nice to see trivial HTML changes show up right away.

Back in (free) IntelliJ 9, I configured "jetty:run" but again, not sure how
to set the exploded directory as I can't find that option. Furthermore,
changes in my environment again are not automatically propagating to the
server - until I click the MAKE PROJECT button ... after which I received
this:

[ERROR] Error reconfiguring/restarting webapp after change in watched files
org.apache.maven.plugin.MojoExecutionException: web.xml does not exist at
location /blah/blah/blah/project/src/main/webapp/WEB-INF/web.xml

Which is consistent with what Andrei suggested ... I guess that option has
to be available to the maven server somehow - but the field alludes me in
the free version of IntelliJ.



-- 
View this message in context: http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5461257.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Optimal Development Cycle

Posted by LutherBaker <lu...@gmail.com>.
Thanks Andrei.

It's just me and I'm just looking to get the (change page, change
controlller -> see it) cycle working smoothly. Workflow was a bad choice of
words on my part.

I prefer to work within the constructs of Maven + any IDE ... so the IDE
hints here have been great. I was able to get NetBeans to work a bit better
... I'll give your IntelliJ solution a go today and hopefully, that'll be
it.

Thanks again,
-Luther
-- 
View this message in context: http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5461054.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Optimal Development Cycle

Posted by Andrei Ionescu <ai...@yahoo.com>.
> The
> same goes for IntelliJ - changing the *htm files isn't visible without a
> restart. I also changed and saved the Home page class file - still, no
> restart or change in page appearance.
In the case of IntelliJ, you need to set the 'exploded' directory to be 
the same as
the webapp source directory. This way the changes to any resource would 
be picked right away (plus the click tracing level as Bob mentioned 
earlier).

> Is there some suggested workflow best practice?
This highly depends on the application you wish to develop, on
the size of your team (or developers contributing to your projects), and 
also to the level of skills each one has - since for each combination 
there are different and more efficient "workflows".

> Which IDE works best out of
> the box ...
None works best out of the box since these are very complex tools.
I for one like IntelliJ more, but the ClickIDE Eclipse plug-in seems the 
most advanced so far and also the most active (I wish Naoki would work 
on a IntelliJ plug-in for Click :) ).

> and what is the best way to build/work on a project - use the
> native WTP and download all the JARS? or can I leverage maven ... or is
> there a hybrid approach that I am missing.
This highly depends on what IDE you use, and how you work.
Personally I use  ANT with a build.xml very similar to that of Click(and 
click examples), or. click-jquery, with a get-deps task that downloads 
some of the dependencies, but I also setup the IDE to
be able to do everything by itself too:
- So when I do very small changes, and the server is already running, I 
compile from the IDE, so the changes will be picked quickly.
- When I do more important changes or releases, than I'll use ANT.

> Also, if this is velocity, is it possible that Velocity will cache these
> files? Is there a parameter I can supply that forces velocity not to do
> this? I was surprised that Eclipse detected changes to the classpath files -
> but not maven's webapp directory.
>
> (looking for solutions other than
> zeroturnaround ... but if that is required ....)
It's not required but it helps allot. This "help" isn't a "Click issue" 
but a Java (JDK) issue (we all wish SUN/Oracle would simply buy JRebel 
and integrate it in the standard JDK ;)).

However, JRebel doesn't work for all Click cases(but for many), since a 
"JRebel plug-in" like the one for Tapestry would be required to 100% 
work without restarting anything.

regards,
Andrei.


Re: Optimal Development Cycle

Posted by Beto <gi...@gmail.com>.
I've forgot to mention that I'm using the Jetty eclipse version:
[quote]
    <packaging>war</packaging>
    <name>Some Security Shiro-jsp Apache Click Webapp</name>
    <build>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>7.0.1.v20091125</version>
                <configuration>
                    <reload>manual</reload>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <!--configuration>
                        <url>http://www.mydomain.com:1234/mymanager</url>
                </configuration-->
            </plugin>
        </plugins>
    </build>

[/quote]

Gilberto

On Tue, Aug 24, 2010 at 2:50 PM, Beto <gi...@gmail.com> wrote:

> Hi Luther,
>
> I'm using Netbeans as well and found the same problem. But the Alex
> Kotchenev's post[1] help me a lot.
>
> Hth,
>
> Gilberto
>
> [1]
> http://www.troymaxventures.com/2009/05/rad-w-tapestry-5-netbeans-67-maven-and.html
>
>
> On Tue, Aug 24, 2010 at 12:34 PM, LutherBaker <lu...@gmail.com>wrote:
>
>>
>> My question is about just general workflow development. I'm having a hard
>> time changing files and having Jetty pick up the changes without a manual
>> restart and I'm sure I must be missing something.
>>
>> Assuming Netbeans, I've created a maven project, included the Click
>> dependencies and invoked jetty via maven command "jetty:run". Jetty starts
>> up just fine and all the "quickstart guide" pages show up. If I change
>> text
>> on a page, I don't see the changes unless I shutdown and restart jetty.
>> The
>> same goes for IntelliJ - changing the *htm files isn't visible without a
>> restart. I also changed and saved the Home page class file - still, no
>> restart or change in page appearance.
>>
>> I fired up Eclipse and imported the same Maven project and it did not
>> detect
>> changes to the htm files ... but it DID detect changes to the class file -
>> after which, it restarted and the page was reloaded.
>>
>> My jetty plugin config includes <scanIntervalSeconds>:
>>
>>            <plugin>
>>                <groupId>org.mortbay.jetty</groupId>
>>                <artifactId>maven-jetty-plugin</artifactId>
>>                <version>6.1.10</version>
>>                <configuration>
>>                    <scanIntervalSeconds>4</scanIntervalSeconds>
>>                    <stopKey>foo</stopKey>
>>                    <stopPort>9999</stopPort>
>>                    <webAppConfig>
>>                        <contextPath>/projx</contextPath>
>>                        <tempDirectory>src/main/webapp</tempDirectory>
>>
>>
>> <defaultsDescriptor>src/main/config/jetty/webdefault.xml</defaultsDescriptor>
>>                    </webAppConfig>
>>
>> <jettyConfig>src/main/config/jetty/jetty.xml</jettyConfig>
>>                    <connectors>
>>                        <connector
>> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>>                            <port>9090</port>
>>                            <maxIdleTime>60000</maxIdleTime>
>>                        </connector>
>>                    </connectors>
>>                </configuration>
>>            </plugin>
>>
>> Is there some suggested workflow best practice? Which IDE works best out
>> of
>> the box ... and what is the best way to build/work on a project - use the
>> native WTP and download all the JARS? or can I leverage maven ... or is
>> there a hybrid approach that I am missing.
>>
>> Also, if this is velocity, is it possible that Velocity will cache these
>> files? Is there a parameter I can supply that forces velocity not to do
>> this? I was surprised that Eclipse detected changes to the classpath files
>> -
>> but not maven's webapp directory.
>>
>> Thanks in advance for any suggestions (looking for solutions other than
>> zeroturnaround ... but if that is required ....)
>>
>> -Luther
>>
>> --
>> View this message in context:
>> http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5457365.html
>> Sent from the click-user mailing list archive at Nabble.com.
>>
>
>

Re: Optimal Development Cycle

Posted by Bob Schellink <sa...@gmail.com>.
Hi Luther,
If you set the application mode trace, Velocity won't cache the
templates and there is no need to restart the server. However the IDE
or maven still need to copy the changed templates to the output
folder.

I don't use maven so cannot give any advice on how to do this.

Kind regards
Bob

On Wednesday, August 25, 2010, LutherBaker <lu...@gmail.com> wrote:
>
> It is an IDE/jetty:run problem because they must work together.
>
> Jetty is scanning for file changes - but the IDE must actually save files to
> the location being scanned. After following Gilberto's link and changing the
> IDEs "Compile on Save" parameter, Jetty restarts now when I make changes to
> class files.
>t
> Unfortunately, the scanning path doesn't seem to pick up the html files in
> src/main/webapp.r It only seems to scan the files in target/* ... so, we're
> close. The class file changes get picked up but changes to the htm files do
> not yet cause Jetty eto restart (and consequently, I continue to see the old
> file in the browser).
>
> Thanks for the suggestions.
> --
> View this message in context: http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5459337.html
> Sent from the click-user mailing list archive at Nabble.com.
>

Re: Optimal Development Cycle

Posted by LutherBaker <lu...@gmail.com>.
It is an IDE/jetty:run problem because they must work together.

Jetty is scanning for file changes - but the IDE must actually save files to
the location being scanned. After following Gilberto's link and changing the
IDEs "Compile on Save" parameter, Jetty restarts now when I make changes to
class files.

Unfortunately, the scanning path doesn't seem to pick up the html files in
src/main/webapp. It only seems to scan the files in target/* ... so, we're
close. The class file changes get picked up but changes to the htm files do
not yet cause Jetty to restart (and consequently, I continue to see the old
file in the browser). 

Thanks for the suggestions.
-- 
View this message in context: http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5459337.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Optimal Development Cycle

Posted by "Md. Jahid Shohel" <de...@gmail.com>.
I might be wrong, but I did not get what running jetty using maven has
something to do with IDE. Also, you did not mention which OS you are using.
Anyways, I think you should look into "scanIntervalTime" of jetty plugin
configuration. [1] can help you with that.

[1] http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

On Tue, Aug 24, 2010 at 7:50 PM, Beto <gi...@gmail.com> wrote:

> Hi Luther,
>
> I'm using Netbeans as well and found the same problem. But the Alex
> Kotchenev's post[1] help me a lot.
>
> Hth,
>
> Gilberto
>
> [1]
> http://www.troymaxventures.com/2009/05/rad-w-tapestry-5-netbeans-67-maven-and.html
>
>
> On Tue, Aug 24, 2010 at 12:34 PM, LutherBaker <lu...@gmail.com>wrote:
>
>>
>> My question is about just general workflow development. I'm having a hard
>> time changing files and having Jetty pick up the changes without a manual
>> restart and I'm sure I must be missing something.
>>
>> Assuming Netbeans, I've created a maven project, included the Click
>> dependencies and invoked jetty via maven command "jetty:run". Jetty starts
>> up just fine and all the "quickstart guide" pages show up. If I change
>> text
>> on a page, I don't see the changes unless I shutdown and restart jetty.
>> The
>> same goes for IntelliJ - changing the *htm files isn't visible without a
>> restart. I also changed and saved the Home page class file - still, no
>> restart or change in page appearance.
>>
>> I fired up Eclipse and imported the same Maven project and it did not
>> detect
>> changes to the htm files ... but it DID detect changes to the class file -
>> after which, it restarted and the page was reloaded.
>>
>> My jetty plugin config includes <scanIntervalSeconds>:
>>
>>            <plugin>
>>                <groupId>org.mortbay.jetty</groupId>
>>                <artifactId>maven-jetty-plugin</artifactId>
>>                <version>6.1.10</version>
>>                <configuration>
>>                    <scanIntervalSeconds>4</scanIntervalSeconds>
>>                    <stopKey>foo</stopKey>
>>                    <stopPort>9999</stopPort>
>>                    <webAppConfig>
>>                        <contextPath>/projx</contextPath>
>>                        <tempDirectory>src/main/webapp</tempDirectory>
>>
>>
>> <defaultsDescriptor>src/main/config/jetty/webdefault.xml</defaultsDescriptor>
>>                    </webAppConfig>
>>
>> <jettyConfig>src/main/config/jetty/jetty.xml</jettyConfig>
>>                    <connectors>
>>                        <connector
>> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>>                            <port>9090</port>
>>                            <maxIdleTime>60000</maxIdleTime>
>>                        </connector>
>>                    </connectors>
>>                </configuration>
>>            </plugin>
>>
>> Is there some suggested workflow best practice? Which IDE works best out
>> of
>> the box ... and what is the best way to build/work on a project - use the
>> native WTP and download all the JARS? or can I leverage maven ... or is
>> there a hybrid approach that I am missing.
>>
>> Also, if this is velocity, is it possible that Velocity will cache these
>> files? Is there a parameter I can supply that forces velocity not to do
>> this? I was surprised that Eclipse detected changes to the classpath files
>> -
>> but not maven's webapp directory.
>>
>> Thanks in advance for any suggestions (looking for solutions other than
>> zeroturnaround ... but if that is required ....)
>>
>> -Luther
>>
>> --
>> View this message in context:
>> http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5457365.html
>> Sent from the click-user mailing list archive at Nabble.com.
>>
>
>

Re: Optimal Development Cycle

Posted by Beto <gi...@gmail.com>.
Hi Luther,

I'm using Netbeans as well and found the same problem. But the Alex
Kotchenev's post[1] help me a lot.

Hth,

Gilberto

[1]
http://www.troymaxventures.com/2009/05/rad-w-tapestry-5-netbeans-67-maven-and.html

On Tue, Aug 24, 2010 at 12:34 PM, LutherBaker <lu...@gmail.com> wrote:

>
> My question is about just general workflow development. I'm having a hard
> time changing files and having Jetty pick up the changes without a manual
> restart and I'm sure I must be missing something.
>
> Assuming Netbeans, I've created a maven project, included the Click
> dependencies and invoked jetty via maven command "jetty:run". Jetty starts
> up just fine and all the "quickstart guide" pages show up. If I change text
> on a page, I don't see the changes unless I shutdown and restart jetty. The
> same goes for IntelliJ - changing the *htm files isn't visible without a
> restart. I also changed and saved the Home page class file - still, no
> restart or change in page appearance.
>
> I fired up Eclipse and imported the same Maven project and it did not
> detect
> changes to the htm files ... but it DID detect changes to the class file -
> after which, it restarted and the page was reloaded.
>
> My jetty plugin config includes <scanIntervalSeconds>:
>
>            <plugin>
>                <groupId>org.mortbay.jetty</groupId>
>                <artifactId>maven-jetty-plugin</artifactId>
>                <version>6.1.10</version>
>                <configuration>
>                    <scanIntervalSeconds>4</scanIntervalSeconds>
>                    <stopKey>foo</stopKey>
>                    <stopPort>9999</stopPort>
>                    <webAppConfig>
>                        <contextPath>/projx</contextPath>
>                        <tempDirectory>src/main/webapp</tempDirectory>
>
>
> <defaultsDescriptor>src/main/config/jetty/webdefault.xml</defaultsDescriptor>
>                    </webAppConfig>
>
> <jettyConfig>src/main/config/jetty/jetty.xml</jettyConfig>
>                    <connectors>
>                        <connector
> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>                            <port>9090</port>
>                            <maxIdleTime>60000</maxIdleTime>
>                        </connector>
>                    </connectors>
>                </configuration>
>            </plugin>
>
> Is there some suggested workflow best practice? Which IDE works best out of
> the box ... and what is the best way to build/work on a project - use the
> native WTP and download all the JARS? or can I leverage maven ... or is
> there a hybrid approach that I am missing.
>
> Also, if this is velocity, is it possible that Velocity will cache these
> files? Is there a parameter I can supply that forces velocity not to do
> this? I was surprised that Eclipse detected changes to the classpath files
> -
> but not maven's webapp directory.
>
> Thanks in advance for any suggestions (looking for solutions other than
> zeroturnaround ... but if that is required ....)
>
> -Luther
>
> --
> View this message in context:
> http://click.1134972.n2.nabble.com/Optimal-Development-Cycle-tp5457365p5457365.html
> Sent from the click-user mailing list archive at Nabble.com.
>