users@glassfish.java.net

Re: GlassFish v3 embedded in Maven?

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Sat, 24 Jan 2009 10:39:51 -0500

The Maven plugin for embedded GlassFish would need to provide a way to
execute a series of asadmin command strings from the pom.xml, without
needing to execute an external command line utility. The build system
does not know if it should run .bat or .sh files, or if the .sh files
have the +x permission. These asadmin command strings would let me
configure things such as a DataSource to an embedded database before
starting my application.


Ryan de Laplante wrote:
> To clarify about the download part, assume that there is no current
> installation of GlassFish on the computer. Even if there is, it will
> not be used. Maven will download my project dependencies and
> GlassFish V3, compile and build my artifcats, start an embedded
> instance of GlassFish, deploy my artifacts into GlassFish, and if
> possible, open a web browser to a URL configured in the pom.xml such
> as http://localhost:8080/demoapp. All the user has to do is checkout
> my source code from a repository, and run:
>
> $ mvn -P demo
>
>
> Ryan de Laplante wrote:
>> I think that I would want embedded GlassFish to stay running after
>> Maven exits. When I want to shut down embedded GlassFish I would run
>> a second Maven command. That is not too important to me. As long
>> as I can run a Maven command to start the demo, I am happy. If
>> GlassFish runs as part of the Maven process and completes the Maven
>> process when it shuts down (how to trigger this?), then that is fine
>> too.
>>
>> I recently saw something similar to this done with Ant, Jetty, and
>> Hypersonic DBMS. The project was the open source AtLeap CMS. I
>> downloaded the project and unzipped it into a folder. All of the
>> files and dependencies were already present under the directory tree
>> because it is Ant based. I executed bin/start-demo and within
>> seconds a web browser opened and I was able to use the software.
>> bin/stop-demo shut everything down. Just now I realized that those
>> are not Ant targets. The point is that I was able to try the
>> software within seconds of downloading it and without having to
>> reading more than a paragraph of the Quick Start Guide.
>>
>> In the Maven world, you don't bundle your dependencies with the
>> project because Maven downloads them for you. I would want a Maven
>> plugin to start/stop GlassFish, not a shell script at the command
>> prompt. This way I could add embedded GlassFish as a dependency in a
>> demo profile, and configure the embedded GlassFish Maven plugin. The
>> demo profile could even be configured to start GlassFish by default,
>> and open a web browser to some URL.
>>
>> What do you think?
>>
>>
>> Thanks,
>> Ryan
>>
>>
>> Sahoo wrote:
>>> So, what is the life of the glassfish server in this case? I assume
>>> it is tied to the maven process in which case when the maven command
>>> exit? Do you want maven to download glassfish as well or you want to
>>> configure glassfish as a system dependency in pom.xml?
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> Ryan de Laplante wrote:
>>>> Hi,
>>>>
>>>> Will I be able to add a dependency line in a maven web project for
>>>> GlassFish v3, and configure a plugin that enables people to start
>>>> glassfish and run my application like they can do with Jetty
>>>> today? I want someone to be able to check out my project from
>>>> subversion and run a single command to download dependencies,
>>>> compile, package, and deploy into an embedded GlassFish v3, and
>>>> open a web browser pointed to my app.
>>>>
>>>> Thanks,
>>>> Ryan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>