mirk
mirk

Reputation: 5520

additional classpath entries in gwt-maven-plugin

I need to set some additional classpath-entries when executing gwt:test`. They mainly contain property-files and are only needed at runtime.

Which configuration parameter do I have to set in my pom to get additional classpath entries?

My current gwt-maven-plugin config looks like (snippet of the pom):

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>${gwtVersion}</version>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
          <goal>test</goal>
          <goal>i18n</goal>
          <goal>generateAsync</goal>
        </goals>
        <configuration>
          <extraJvmArgs>-Xmx1024M -Xss512M</extraJvmArgs>
        </configuration>
      </execution>
    </executions>
    <!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
         documentation at codehaus.org -->
    <configuration>
      <mode>htmlunit</mode>
      <runTarget>Myproject.html</runTarget>
      <out>${webappDirectory}</out>
      <hostedWebapp>
        ${project.build.directory}/${project.build.finalName}
      </hostedWebapp>
      <i18nMessagesBundle>myproject.web.client.Messages</i18nMessagesBundle>
    </configuration>
  </plugin>

I am using gwt 2.5.1. I have already spent more time than I expected on this small issue.

Upvotes: 0

Views: 1097

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

gwt:test will use the standard Maven test classpath, including —for resources– dependencies with <scope>test</scope> and testResources directories.

Assuming your properties files are local to your Maven module, then simply put them in src/test/resources, or add the appropriate parent folder as a testResource:

<build>
  <testResources>
    <testResource>
      <directory>${basedir}/src/test/resources</directory>
    </testResource>
    <testResource>
      <directory>${basedir}/src/test-properties-files</directory>
    </testResource>
  </testResources>

Upvotes: 2

Related Questions