Hi Guys,
I've looked into this a little and found a few things out...
1. A war can most certainly be a dependency, and dependency:unpack can
be used to unpack it (providing the dependency is hosted in a repository).
2. Providing we make a mojo plugin available, the unpacked ./data
directory can be replaced by that of the local project/module.
(./src/main/config)
1. This can be done starting up an embedded app server
(jetty/tomcat/whatever see maven cargo) with the geoserver war and
-DGEOSERVER_DATA_DIR=${basedir}/src/main/config
3. It's would also be possible to run an embedded
appserver+geoserver inside maven, so "out of the box" spatial data
development/configuration/testing/hosting of (.src/main/config) is
available.
4. The geoserver.war can be repacked with the newly developed
(./src/main/config) spatial data/configuration replacing ./data
The above would be pretty neat for those wishing to
package/version/release/develop applications to spatial data, as well as ear
releases.
More Thoughts?
ps for anyone wanting a vague reference of this, I've worked on the
gwt-maven 2 sample project (but can't take credit for the magic behind the
scene). This project can download a gwt release as a dependency (either
win,linux or mac).. unpack gwt, configure all the application sources for
the gwt shell to run (this is an embedded tomcat with special features). End
result, is that gwt runs out of the box for developing your own customer
applications, the same thing we could achieve with geoserver. So very
similar benefits could be made available to geoserver users and thus
increase it's maven user base.
You can try the gwt example as below:
svn export
http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-sample
cd maven-googlewebtoolkit2-sample
mvn install
cd war
mvn gwt:gwt
On Mon, Apr 14, 2008 at 5:09 PM, Andrea Aime <[EMAIL PROTECTED]> wrote:
> Andrew Hughes ha scritto:
>
> Hi All,
> >
> > I've tried to find the "best fit" solution to what I think is a fairly
> > common problem:
> >
> > My WebApp (war) needs to call a customized geoserver. Specifically, I
> > want my geoserver deployed with my own data, styles, user/pass eta eta
> > eta....
> >
> > From everything I can see, I should configure the appserver to have
> > -DGEOSERVER_DATA_DIR and that's the "customized" config I require (can
> > redeploy a new zip to the machine eta eta eta). However, this isn't the
> > easiest thing to do from an operational sense... it would be much easier if
> > I could deploy my geoserver_data within the geoserver.war itself. After all,
> > its what war's are there for.
> >
> > So, I've given this some thought and seen a similar approach in other
> > projects. Maven mojo plugins often download resources from zip's, unpack
> > them, use the contents of the unpacked artifact, repackage and then
> > release/distrubute/deployed eta eta eta.
> >
> > If geoserver.war is available in a maven repository(?) it can be
> > downloaded (version specific) as a plugin dependency, it can be unpacked
> > (target/geoserver/*), and the contents of the data dir can be replaced by
> > the contents the client user wants/has. This means that I can release my own
> > spatial data and server with all the benefits of svn, geoserver and Maven's
> > lifecycle. It also means that the war can be packed inside an ear to be
> > coupled with your applications versioning/release cycle eta eta eta (another
> > great way to deploy an application that is dependent on a specific geoserver
> > version or config).
> >
> > I'm sure there are other ways around this too, where I might checkout
> > geoserver src as a module in my own project, and customize it there.... from
> > a "once off" perspecitve that might be a "quicker"... but doesn't represent
> > an easy solution for the next person that wants to do this. It also makes
> > versioning of the geoserver dependency painful.
> >
>
> We don't have any support for fiddling with the generated .war, and it's
> not published on any repository either afaik... how would you depend
> on a .war? Maven dependency mechanism is made for classpath dependencies.
>
> Anyways, if you check out the sources, you can build geoserver with
> mvn clean install -DconfigDirectory=/path/to/the/parent/of/the/data/dir
> -DconfigId=dataDirName
> and you'll get a geoserver.war that has the data dir you pointed
> the build at
>
> Cheers
> Andrea
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel