[jetty-dev] Attempting to integrate quickstart in the build process

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Attempting to integrate quickstart in the build process

Federico Fissore
Hi all

I'm struggling with the quickstart documentation [1] and I haven't been
able to trigger it so far
I would like to pre generate quickstart-web.xml, so that the docker
jetty image packed with my war will have shorter startup times.

It's unclear
  - if the contex file must still be created, even if quickstart file is
pregenerated
  - how I will know quickstart has been used, despite the supposed
shorter startup times

I have found no example of maven/gradle integration, and the docs don't
describe one.

Is anyone using it? How did you integrate it?

[1] http://www.eclipse.org/jetty/documentation/9.4.x/quickstart-webapp.html
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Attempting to integrate quickstart in the build process

Jan Bartel
So it looks like we might need to do a bit more work on the documentation.

I'm not really sure which aspect you're having trouble with:  the pre-generation of the quickstart war or the use of the webapp afterwards?

If it's pre-generation, you don't necessarily have to do a special step in the generation of your webapp to generate the quickstart-web.xml. Instead, you can just let jetty lazily generate the quickstart-web.xml when the webapp starts for the first time.  To do that, use the instructions on the doco page you linked and follow the section "In XML".  The "autoPregenerate=true" will tell jetty to generate the quickstart-web.xml if it isn't already present. When it generates the quickstart descriptor, you'll see a line like this on startup: 

INFO:oejq.QuickStartDescriptorGenerator:main: Quickstart generating

You'll know its faster if you have any annotations in your webapp and a lot of jars in WEB-INF/lib, because it will be noticeably faster to start ;).  Without the quickstart, or when it's lazily generating the quickstart for the first time, you'll see a line like:

INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=xxxms

On subsequent restarts you won't see that line.

As the doco mentions, there is a goal of the maven-jetty-plugin that uses quickstart to generate an effective web.xml for you - if you want you can save the output of mvn jetty:effective-web-xml into a file called quickstart-web.xml and put it into your webapp, but that would be a bit of a manual process.

Sounds like it would be useful to have a maven plugin that did the quickstart generation as part of a webapp build cycle, don't fancy contributing one do you? :)

cheers
Jan


On 10 May 2017 at 15:19, Federico Fissore <[hidden email]> wrote:
Hi all

I'm struggling with the quickstart documentation [1] and I haven't been able to trigger it so far
I would like to pre generate quickstart-web.xml, so that the docker jetty image packed with my war will have shorter startup times.

It's unclear
 - if the contex file must still be created, even if quickstart file is pregenerated
 - how I will know quickstart has been used, despite the supposed shorter startup times

I have found no example of maven/gradle integration, and the docs don't describe one.

Is anyone using it? How did you integrate it?

[1] http://www.eclipse.org/jetty/documentation/9.4.x/quickstart-webapp.html
_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--
Jan Bartel <[hidden email]>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Attempting to integrate quickstart in the build process

Federico Fissore


Jan Bartel ha scritto il 10/05/2017 alle 16:07:
> So it looks like we might need to do a bit more work on the documentation.
>
> I'm not really sure which aspect you're having trouble with:  the
> pre-generation of the quickstart war or the use of the webapp afterwards?
>

Actually both: while I succeeded in using mvn jetty:effective-web-xml
(but didn't use it, see below), I failed to do that from inside docker
container (see attached file)


> If it's pre-generation, you don't necessarily have to do a special step
> in the generation of your webapp to generate the quickstart-web.xml.
[...]


I skipped the lazy generation because what I need is to make it faster
from the first run: I'm in the process of implementing continuous
delivery and webapps have to restart as fast as possible


>
> INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=xxxms
>
> On subsequent restarts you won't see that line.


Ah good to know: then I suppose that, with a pregenerated file, I won't
see that line any longer


>
> As the doco mentions, there is a goal of the maven-jetty-plugin that
> uses quickstart to generate an effective web.xml for you - if you want
> you can save the output of mvn jetty:effective-web-xml into a file
> called quickstart-web.xml and put it into your webapp, but that would be
> a bit of a manual process.
>

docs also mention that that output may contain stuff found on jars
included by maven but which are not included in the war: that's why I
tried it to see what was its output and then looked for ways to make it
"more right"


> Sounds like it would be useful to have a maven plugin that did the
> quickstart generation as part of a webapp build cycle, don't fancy
> contributing one do you? :)


Indeed I do and, time permitting, I'll make one

regards

federico

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev

quickstart_from_inside_docker.txt (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Attempting to integrate quickstart in the build process

Jan Bartel
Great! I've created an issue to track this: https://github.com/eclipse/jetty.project/issues/1542.

Jan

On 10 May 2017 at 17:24, Federico Fissore <[hidden email]> wrote:


Jan Bartel ha scritto il 10/05/2017 alle 16:07:
So it looks like we might need to do a bit more work on the documentation.

I'm not really sure which aspect you're having trouble with:  the
pre-generation of the quickstart war or the use of the webapp afterwards?


Actually both: while I succeeded in using mvn jetty:effective-web-xml (but didn't use it, see below), I failed to do that from inside docker container (see attached file)


If it's pre-generation, you don't necessarily have to do a special step
in the generation of your webapp to generate the quickstart-web.xml.
[...]


I skipped the lazy generation because what I need is to make it faster from the first run: I'm in the process of implementing continuous delivery and webapps have to restart as fast as possible



INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=xxxms

On subsequent restarts you won't see that line.


Ah good to know: then I suppose that, with a pregenerated file, I won't see that line any longer



As the doco mentions, there is a goal of the maven-jetty-plugin that
uses quickstart to generate an effective web.xml for you - if you want
you can save the output of mvn jetty:effective-web-xml into a file
called quickstart-web.xml and put it into your webapp, but that would be
a bit of a manual process.


docs also mention that that output may contain stuff found on jars included by maven but which are not included in the war: that's why I tried it to see what was its output and then looked for ways to make it "more right"


Sounds like it would be useful to have a maven plugin that did the
quickstart generation as part of a webapp build cycle, don't fancy
contributing one do you? :)


Indeed I do and, time permitting, I'll make one

regards

federico

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--
Jan Bartel <[hidden email]>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Attempting to integrate quickstart in the build process

Federico Fissore
After a call with Simone (which I'm fortunate to have as JUG mate) I
ended up with just adding an execution to the jetty maven plugin (see
attached pom.xml portion)
I think this may be enough and it's not necessary to code any maven plugin.

However I was not able to start the webapp.
I had to add a context file (root.xml file attached), otherwise jetty
still used AnnotationConfiguration.
Once added, jetty failed with the attached exception, about missing
taglibs jars
Indeed there are no taglibs jars, because there are not JSPs (it's a
jersey app, serving REST api only)

Any hint is appreciated

Regards

federico

Jan Bartel ha scritto il 11/05/2017 alle 11:50:
> Great! I've created an issue to track this:
> https://github.com/eclipse/jetty.project/issues/1542.
>
> Jan

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev

quickstart.pom.xml (821 bytes) Download Attachment
exception.txt (8K) Download Attachment
root.xml (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Attempting to integrate quickstart in the build process

Federico Fissore
One more thing: Simone insisted that the warning about using jetty maven
plugin "effective-web-xml" was less scary that I intended, and hence I
used it

Federico Fissore ha scritto il 11/05/2017 alle 18:00:

> After a call with Simone (which I'm fortunate to have as JUG mate) I
> ended up with just adding an execution to the jetty maven plugin (see
> attached pom.xml portion)
> I think this may be enough and it's not necessary to code any maven plugin.
>
> However I was not able to start the webapp.
> I had to add a context file (root.xml file attached), otherwise jetty
> still used AnnotationConfiguration.
> Once added, jetty failed with the attached exception, about missing
> taglibs jars
> Indeed there are no taglibs jars, because there are not JSPs (it's a
> jersey app, serving REST api only)
>
> Any hint is appreciated
>
> Regards
>
> federico
>
> Jan Bartel ha scritto il 11/05/2017 alle 11:50:
>> Great! I've created an issue to track this:
>> https://github.com/eclipse/jetty.project/issues/1542.
>>
>> Jan
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>

_______________________________________________
jetty-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev