maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wells" <jwe...@bea.com>
Subject [M2] Configuration parameters for my Mojo(s)
Date Mon, 16 Jan 2006 12:44:35 GMT
I have a plugin that defines a new packaging type.  This is basically
the same as the jar packaging type, except it does nothing in the test
phase, has a special packaging phase (where some manifest entries are
added) and an integration-test phase that runs an integration test.

I am able to modify parameters in the "packaging" phase with no problem.
However, in the integration-test phase, for some reason, my parameters
are not getting set from the pom.xml.  Here is the XML snippet from my
pom.xml:

      <plugin>
        <groupId>com.bea.core.maven2.plugins</groupId>
        <artifactId>maven-osgi-bundler-plugin</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>main</id>
            <phase>package</phase>
            <goals>
              <goal>osgi-bundle</goal>
            </goals>
            <configuration>
 
<bundleActivator>com.bea.jetty.JettyActivator</bundleActivator>
              <bundleName>Jetty HTTP</bundleName>
              <bundleDescription>OSGi HTTP service using
Jetty</bundleDescription>
 
<bundleSymbolicName>com.bea.core.jetty</bundleSymbolicName>
              <importPackages>
                <importPackage>org.osgi.framework</importPackage>
                <importPackage>org.osgi.service.log</importPackage>
                <importPackage>com.bea.core.dioce</importPackage>
                <importPackage>com.bea.core.netio</importPackage>
                <importPackage>com.bea.core.wm</importPackage>
              </importPackages>
              <exportPackages>
                <exportPackage>javax.servlet;version=2.5</exportPackage>
 
<exportPackage>javax.servlet.http;version=2.5</exportPackage>
 
<exportPackage>org.osgi.service.http;version=1.2</exportPackage>
              </exportPackages>
              <bundleClasspaths>
                <bundleClasspath>.</bundleClasspath>
                <bundleClasspath>lib/http-service.jar</bundleClasspath>
                <bundleClasspath>lib/servlet.jar</bundleClasspath>
              </bundleClasspaths>
            </configuration>
          </execution>
          <execution>
            <id>test</id>
            <phase>package</phase>
            <goals>
              <goal>test-osgi-bundle</goal>
            </goals>
            <configuration>
 
<bundleActivator>com.bea.jetty.test.TestActivator</bundleActivator>
              <bundleName>Jetty HTTP Tests</bundleName>
              <bundleDescription>OSGi HTTP service using Jetty Testing
Bundle</bundleDescription>
 
<bundleSymbolicName>com.bea.core.jetty.tests</bundleSymbolicName>
              <importPackages>
                <importPackage>org.osgi.framework</importPackage>
                <importPackage>javax.servlet</importPackage>
                <importPackage>javax.servlet.http</importPackage>
                <importPackage>org.osgi.service.http</importPackage>
              </importPackages>
            </configuration>
          </execution>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>run-osgi-test</goal>
            </goals>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>


With no problem at all the various variables I set in the "packaging"
phase are being set.  There are two mojo's there, with the goals
osgi-bundle and test-osgi-bundle.  Both of those things seem to be
getting their configuration parameters just fine from the pom.xml.

However, my run-osgi-test goal that happens from the integration-test
phase is NOT getting the configuration parameter.

Here is the output from "mvn -X integration-test" (well, some of it)...

[DEBUG] Configuring mojo
'com.bea.core.maven2.plugins:maven-osgi-bundler-plugin:
1.0.0-SNAPSHOT:run-osgi-test' -->
[DEBUG]   (f) buildDirectory = C:\weblogic\dev\core\modules\jetty\target
[DEBUG]   (f) integrationDirectoryName = integration-test
[DEBUG]   (f) loadFileName = loader.xml
[DEBUG]   (f) project = org.apache.maven.project.MavenProject@b4ee3822
[DEBUG]   (f) skip = false
[DEBUG]   (f) testTimeout = 300000


Etc.  At this point, shouldn't "skip" be "true" since I set it to "true"
in the pom.xml?

Here is the java:

/**
 * Should these tests be skipped?
 * @parameter expression="false"
 */
private boolean skip;


I have tried several things:

1) Making it a "String" rather than a Boolean
2) Moving it to the same package as the other mojo's that *are* getting
their variables configured properly
3) Having multiple "plugin" definitions in the pom file

Any help would be appreciated.

John Wells (Aziz)
jwells@bea.comNOSPAM

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message