Rik Sweeney
Rik Sweeney

Reputation: 63

Specifying the classpath in Maven's jspc-maven-plugin plugin

I am trying to use Maven's jspc-maven-plugin to compile my JSPs. The problem I am encountering is that it is refusing to compile any JSPs that reference a class that is not in the target/classes directory.

e.g.

<jsp:useBean id="MY_ID" class="com.mycompany.common.my_id" scope="session"/>

The my_id class is in a jar used by several of the projects so it is built separately and then included as a dependency to the project.

Is there any way I can get the plugin to search a classpath for this jar file? Being able to scan the repository would be ideal. Here is how the plugin is currently configured:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jspc-maven-plugin</artifactId>
    <version>1.4.6</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
            <id>compile</id>
        </execution>
    </executions>
    <configuration>
    </configuration>
</plugin>

Thanks

Richard

Upvotes: 2

Views: 3453

Answers (1)

ᄂ ᄀ
ᄂ ᄀ

Reputation: 5782

For compilation the plugin should use dependencies as specified in POM file. I am not sure about the version you are using, but the latest one works fine when compile dependencies are properly specified:

 <plugin>
    <groupId>org.codehaus.mojo.jspc</groupId>
    <artifactId>jspc-maven-plugin</artifactId>
    <version>2.0-alpha-3</version>
    <configuration>
      <workingDirectory>${project.build.directory}/jspc</workingDirectory>
    </configuration>
    <executions>
      <execution>
        <phase>compile</phase>
        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.mojo.jspc</groupId>
        <artifactId>jspc-compiler-tomcat6</artifactId>
        <version>2.0-alpha-3</version>
      </dependency>
    </dependencies>
  </plugin>

Upvotes: 2

Related Questions