I assume the problem is the helper plugin and I would like to remove it:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>attach-war</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/geoserver.war</file>
<type>war</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
I think I have an approach, but it involves configuring the war and jetty
plugins. Still arguing over where stuff goes, since I am mostly reverse
engineering the default WAR packaging.
Start with JAR packaging: This may not be worth it, easier to skip
deployment ...
<packaging>jar</packaging>
Exclude some stuff from the JAR packaging:
<!-- jar packaging (to prevent storing large wars in nexus) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<classesDirectory>${project.build.directory}/geoserver</classesDirectory>
<excludes>WEB-INF/lib/*</excludes>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
Manually define a WAR (rather than use a helper plugin):
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<webResources>
<resource>
<directory>target/geoserver</directory>
</resource>
</webResources>
</configuration>
</plugin>
Configure JETTY:
<!-- jetty -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webApp>
<contextPath>/geoserver</contextPath>
<descriptor>${project.basedir}/geoserver/WEB-INF/web.xml</descriptor>
</webApp>
<webAppSourceDirectory>${project.build.directory}/geoserver</webAppSourceDirectory>
<connectors>
<connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>${jetty.port}</port>
<maxIdleTime>10000</maxIdleTime>
</connector>
</connectors>
<supportedPackagings>
<supportedPackaging>jar</supportedPackaging>
</supportedPackagings>
<stopPort>${jetty.stopPort}</stopPort>
<stopKey>GEOSERVER_JETTY_STOPKEY</stopKey>
<daemon>false</daemon>
<contextXml>${project.build.testOutputDirectory}/jetty-context.xml</contextXml>
</configuration>
</plugin>
Until we figure out deploy I was skipping it:
<!-- deploy -->
<!-- See release_gse where use of mvn deploy:deploy-file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
--
Jody Garnett
On Fri, 17 Jan 2020 at 07:02, Gabriel Roldan <[email protected]>
wrote:
> Hi Jody,
> I've noticed the same thing recently too, and it's the same with the
> geowebcache gwc-web project, the jar is deployed with the full war contents.
>
> I'm not sure how to fix it though, have you found a solution? if not I
> guess I could do some research over the next few days.
>
> Cheers,
> Gabriel
>
> On Thu, 16 Jan 2020 at 18:49, Jody Garnett <[email protected]> wrote:
>
>> I have been intent on reusing geoserver gs-web-app war, something that we
>> noticed was not working during foss4g workshop. The idea was to publish
>> this as a jar (to save space) rather than deploy the war to our repository
>> each time.
>>
>> With the upcoming 2.16.2 release I figured I would look again, here are
>> my findings:
>>
>> 1) The gs-web-app jar is empty (no content is included)
>> 2) A misconfigured deploy is causing geoserver.war to be deployed twice
>> (both as a jar and as a war)
>>
>> Details https://osgeo-org.atlassian.net/browse/GEOS-9414
>> --
>> Jody Garnett
>> _______________________________________________
>> Geoserver-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
>
>
> --
> Gabriel Roldán
>
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel