Problem defining SystemProperties in jetty-maven-plugin

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

Problem defining SystemProperties in jetty-maven-plugin

Jacob Bergöö
Hi,
I am right now using a lot of -D flags when I start
up my jetty-maven-plugin and I want to be able to define them in my pom.xml
file but the change of package names cause problem.

the error state:

[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for:
org.mortbay.jetty:jetty-maven-plugin:7.0.1.v20091125
Cause: Class name which was explicitly given in configuration using
'implementation' attribute: 'org.eclipse.jetty.plugin.util.SystemProperties'
cannot be loaded

I have looked through the org.eclipse.jetty jar files but haven't found
SystemProperties and SystemProperty classes.

This is how my definition in the pom files looks with the system properties:

<plugin>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <configuration>
       <systemProperties
implementation="org.mortbay.jetty.plugin.util.SystemProperties">
               <systemProperty
implementation="org.mortbay.jetty.plugin.util.SystemProperty">
                       <name>log4j.configuration</name>
                       <value>"file:src/main/config/log4j.properties"</value>
               </systemProperty>

               ....

               <systemProperty
implementation="org.mortbay.jetty.plugin.util.SystemProperty">
                       <name>initial.propertiesfilename</name>
                       <value>src/main/config/System.properties</value>
               </systemProperty>
       </systemProperties>
       <scanIntervalSeconds>0</scanIntervalSeconds>

<classesDirectory>${basedir}/target/${build.finalName}/WEB-INF/classes</classesDirectory>
       <webAppConfig>
               <contextPath>/</contextPath>
               <defaultsDescriptor>src/main/config/webdefault.xml</defaultsDescriptor>
               <baseResource
implementation="org.eclipse.jetty.util.resource.ResourceCollection">

<resourcesAsCSV>${basedir}/src/main/webapp,target/${build.finalName}</resourcesAsCSV>
               </baseResource>
       </webAppConfig>
       <connectors>
               <connector
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                          <port>7001</port>
                          <maxIdleTime>60000</maxIdleTime>
               </connector>
       </connectors>
   </configuration>
</plugin>

can anyone point out the right package definition to solve this?

Thanks,
Jacob
Reply | Threaded
Open this post in threaded view
|

Re: Problem defining SystemProperties in jetty-maven-plugin

Bogdan Flueras
Hi Jacob,

First, I think you are mixing 2 different versions of maven jetty plugin - org.mortbay.jetty and org.eclipse.jetty.
http://stackoverflow.com/questions/2516782/why-2-versions-of-jetty-maven-plugins

To answer your question: the correct package is:org.mortbay.jetty.plugin.*

Here's my config:
<plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.0.0.M0</version>
               
               <configuration>
                   <systemProperties implementation="org.mortbay.jetty.plugin.SystemProperties">
                        <systemProperty implementation="org.mortbay.jetty.plugin.SystemProperty">
                            <name>foo</name>
                            <value>bar</value>
                        </systemProperty>
                   </systemProperties>
                   
                   <webAppSourceDirectory>${project.build.directory}/${project.name}-${project.version}</webAppSourceDirectory>
                </configuration>
            </plugin>


Jacob Bergöö wrote
Hi,
I am right now using a lot of -D flags when I start
up my jetty-maven-plugin and I want to be able to define them in my pom.xml
file but the change of package names cause problem.

the error state:

[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for:
org.mortbay.jetty:jetty-maven-plugin:7.0.1.v20091125
Cause: Class name which was explicitly given in configuration using
'implementation' attribute: 'org.eclipse.jetty.plugin.util.SystemProperties'
cannot be loaded

I have looked through the org.eclipse.jetty jar files but haven't found
SystemProperties and SystemProperty classes.

This is how my definition in the pom files looks with the system properties:

<plugin>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <configuration>
       <systemProperties
implementation="org.mortbay.jetty.plugin.util.SystemProperties">
               <systemProperty
implementation="org.mortbay.jetty.plugin.util.SystemProperty">
                       <name>log4j.configuration</name>
                       <value>"file:src/main/config/log4j.properties"</value>
               </systemProperty>

               ....

               <systemProperty
implementation="org.mortbay.jetty.plugin.util.SystemProperty">
                       <name>initial.propertiesfilename</name>
                       <value>src/main/config/System.properties</value>
               </systemProperty>
       </systemProperties>
       <scanIntervalSeconds>0</scanIntervalSeconds>

<classesDirectory>${basedir}/target/${build.finalName}/WEB-INF/classes</classesDirectory>
       <webAppConfig>
               <contextPath>/</contextPath>
               <defaultsDescriptor>src/main/config/webdefault.xml</defaultsDescriptor>
               <baseResource
implementation="org.eclipse.jetty.util.resource.ResourceCollection">

<resourcesAsCSV>${basedir}/src/main/webapp,target/${build.finalName}</resourcesAsCSV>
               </baseResource>
       </webAppConfig>
       <connectors>
               <connector
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                          <port>7001</port>
                          <maxIdleTime>60000</maxIdleTime>
               </connector>
       </connectors>
   </configuration>
</plugin>

can anyone point out the right package definition to solve this?

Thanks,
Jacob