Hi Carlo,
Very interesting idea and is something that I have wanted to see in
GeoServer for quite some time, the start of an extension management
framework.
One question I have is how will the manifest lookup occur? Will it be a
simple lookup of all manifests on the classpath? Will there be some marker
attribute used to define a jar as a geoserver plugin?
The REST api looks good.
Can't comment on whether 2.2.x is appropriate without looking at any code
but in general this all sounds like mostly build work and additive code
which shouldn't be a problem.
$0.02
-Justin
On Thu, Nov 29, 2012 at 7:12 AM, Carlo Cancellieri <[email protected]
> wrote:
> Hi all,
> to complete the integration of GeoServer (and all of the installed
> plugin) into our continuous integration environment I need to provide a
> rest service to expose (at least):
>
> .. release (version)
> .. revision (svn tag or git hash)
> .. build date (optional)
>
> for GeoServer and all of the installed extensions (f.e.):
>
> .. monitoring
> .. control flow
>
> plus other custom plugins.
>
> So I need to create an extensible mechanisms to provide those info. There
> are various possible approaches.
> Here is my proposal based on java Manifest + maven and its plugins.
>
> 1. Each project or extension may register it's Manifest bean into the
> spring context
> 2. For each GET request on the /rest/about[.format] path, a file in the
> '.format' format will be returned listing all of the registered Manifest
> beans with all of the stored entries.
> 3. The output format can be produced using FreeMarker
>
> Note also that this is an extensible and customisable approach:
>
> 1. Example on how to extend/customize:
>
> I'll setup for my custom plugin manifest entries adding hudson environment
> and build information using maven variables with:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <manifest>
> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
> </manifest>
> <manifestEntries>
> <Application-Name>${project.build.finalname}</Application-Name>
> <Application-Version>${project.version}</Application-Version>
> <Iteration-Name>${iteration}</Iteration-Name>
> <Build-Time>${maven.build.timestamp}</Build-Time>
> <HudsonBuildNumber>${BUILD_NUMBER}</HudsonBuildNumber>
> <HudsonBuildId>${BUILD_ID}</HudsonBuildId>
> <HudsonJobName>${JOB_NAME}</HudsonJobName>
> <HudsonBuildTag>${BUILD_TAG}</HudsonBuildTag>
> <HudsonExecutorNumber>${EXECUTOR_NUMBER}</HudsonExecutorNumber>
> <HudsonJavaHome>${JAVA_HOME}</HudsonJavaHome>
> <HudsonWorkspace>${WORKSPACE}</HudsonWorkspace>
> <HudsonUrl>${HUDSON_URL}</HudsonUrl>
> <HudsonSvnRevision>${SVN_REVISION}</HudsonSvnRevision>
> <HudsonSvnTag>${SVN_TAG}</HudsonSvnTag>
> </manifestEntries>
> </archive>
> </configuration>
> </plugin>
>
>
> The result will be a file with some more information (coming from my
> extension build) into the custom plugin section.
>
> 2. A simple example for geoserver with monitoring plugin installed into
> the lib dir:
>
> doing a get on http://GEOSERVER/rest/about.xml (with username and
> password)
>
> will result in something like:
>
> <about>
> <GeoServer>
> <Project-version>..--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>daabbfaafbbfddbbbeffabbbb674bbbb1361ddd<</Project-revision>
> </GeoServer>
> <GeoTools>
> <Project-version>--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>fff8aaaf435477737fff915bbbc3862cccb145<<</Project-revision>
> </GeoTools>
> <Monitoring>
> <Project-version>..--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>fff8aaaf435477737fff915bbbc3862cccb146<<</Project-revision>
> </Monitoring>
> </about>
>
> 3. A simple example for geoserver with monitoring and my custom plugin
> installed into the lib dir:
>
> get http://GEOSERVER/rest/about.xml
>
> will result in something like:
>
> <about>
> <GeoServer>
> <Project-version>..--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>daabbfaafbbfddbbbeffabbbb674bbbb1361ddd<</Project-revision>
> </GeoServer>
> <GeoTools>
> <Project-version>--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>fff8aaaf435477737fff915bbbc3862cccb145<<</Project-revision>
> </GeoTools>
> <Monitoring>
> <Project-version>..--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
>
> <Project-revision>fff8aaaf435477737fff915bbbc3862cccb146<<</Project-revision>
> </Monitoring>
> <MyCustom>
> <Project-version>1.0.--SNAPSHOT</Project-version>
> <Build-Jdk>....--rc<</<Build-Jdk>
> <Application-Name>MyCustom</Application-Name>
> <Application-Version>..--SNAPSHOT</Application-Version>
> <Build-Time>...</Build-Time>
> <HudsonBuildNumber>9<<</HudsonBuildNumber>
> <HudsonBuildId><</HudsonBuildId>
> <HudsonJobName>GEO_TS_GEOSERVER_MyCustom_BUILD</HudsonJobName>
> <HudsonBuildTag>2<<</HudsonBuildTag>
> <HudsonExecutorNumber><</HudsonExecutorNumber>
> <HudsonJavaHome>..</HudsonJavaHome>
> <HudsonWorkspace>...</HudsonWorkspace>
> <HudsonUrl>http://....</HudsonUrl>
> <HudsonSvnRevision>r093<<</HudsonSvnRevision>
> <HudsonSvnTag>REL_79<<</HudsonSvnTag>
> </MyCustom>
> </about>
>
>
> Note also that non maven project can still use this using their custom
> (ant?) mechanisms to update their /META-INF/MANIFEST.MF file.
>
> What do you think about this? May I have to produce a proposal page? is it
> possible to have this on the 2.2.x branch (in the future)?
>
> Ref.:
> http://maven.apache.org/shared/maven-archiver/examples/manifest.html
> http://docs.oracle.com/javase/....//docs/api/java/util/jar/Manifest.html
>
> https://github.com/kevinsawicki/github-maven-example/blob/master/example/pom.xml
>
>
> Cheers,
> Carlo Cancellieri - GeoSolutions SAS
>
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
VERIFY Test and improve your parallel project with help from experts
and peers. http://goparallel.sourceforge.net
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel