You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Amir Mistric <am...@nemours.org> on 2007/11/27 00:24:38 UTC

overriding jspc-maven-plugin

Hi

I have a super-parent POM that all of my projects inherit...
90% of the projects are WAR files and few are multi module JARs....

I would like to define a JSPC compile plugin at the super-parent POM level but the problem arises when building non-WAR projects....

How can I "redefine" specific project's POMs (the ones that are JARs) not to "consider" JSPC plugin?


The obvious solution is not to define jspc-maven-plugin at the super-parent POM level but in each project individually...
But that means I have to specify something like this in multiple places which I am trying to avoid:

      <plugin>
        <groupId>org.codehaus.mojo.jspc</groupId>
        <artifactId>jspc-maven-plugin</artifactId>
        <version>2.0-alpha-1</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo.jspc</groupId>
            <artifactId>jspc-compiler-tomcat5</artifactId>
            <version>2.0-alpha-1</version>
          </dependency>
        </dependencies>
        <configuration>
          <sources>
            <directory>${basedir}/src/main/resources/</directory>
            <includes>
              <include>**/*.jsp</include>
            </includes>
          </sources>
          <source>1.6</source>
          <target>1.6</target>
          <verbose>1</verbose>
        </configuration>
      </plugin>


Is there a way to do this? Currently I get following error when I try to build one of my JAR projects:

[WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
[INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\jsp-source
[INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\classes
[INFO] Compiling JSP source files to C:\mycompany\project\COOLP\mycompany-common\target/jsp-source
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The -uriroot option must specify a pre-existing directory
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.jasper.JasperException: The -uriroot option must specify a pre-existing directory


Re: overriding jspc-maven-plugin

Posted by Stephen Connolly <st...@gmail.com>.
Put your config in a <pluginManagement> and that way the war projects
need only specify

<plugin>
       <groupId>org.codehaus.mojo.jspc</groupId>
       <artifactId>jspc-maven-plugin</artifactId>
</plugin>

and they'll pick up the config from the plugin management section.

Alternatively, use two parent poms, one for the jars and the other for the wars

These need not require a change in directory structure

/pom.xml (the super pom)
/jar-common-config/pom.xml (the jar common parent)
/war-common-config/pom.xml (the war common parent)
/jar-a/pom.xml
/jar-b/pom.xml
...
/war-a/pom.xml
/war-b/pom.xml

where /pom.xml has

<project>
...
<modules>
<module>jar-common-config</module>
<module>war-common-config</module>
<module>jar-a</module>
<module>jar-b</module>
...
<module>war-a</module>
<module>war-b</module>
...
</modules>

That will allow building all the modules from the root pom

/jar-a/pom.xml's parent would be jar-common-config with
<relativePath>../jar-common-config/pom.xml</relativePath> (although
I'm unsure if this is needed I think it's to do with release)
and
/war-a/pom.xml's parent would be war-common-config...

I prefer using the <pluginManagement> technique, but the separate
parents can work also.

-Stephen
On Nov 27, 2007 1:49 AM, Wayne Fay <wa...@gmail.com> wrote:
> Many plugins offer a <skip> configuration option. Check the plugin
> docs to see if jspc-m-p does, and if it does not, file a JIRA to
> request that someone else add it or do it yourself. Then you could
> simply add the plugin in the parent, and declare it with
> <skip>true</skip> in the non-WAR children projects.
>
> Wayne
>
>
> On 11/26/07, Amir Mistric <am...@nemours.org> wrote:
> > Hi
> >
> > I have a super-parent POM that all of my projects inherit...
> > 90% of the projects are WAR files and few are multi module JARs....
> >
> > I would like to define a JSPC compile plugin at the super-parent POM level but the problem arises when building non-WAR projects....
> >
> > How can I "redefine" specific project's POMs (the ones that are JARs) not to "consider" JSPC plugin?
> >
> >
> > The obvious solution is not to define jspc-maven-plugin at the super-parent POM level but in each project individually...
> > But that means I have to specify something like this in multiple places which I am trying to avoid:
> >
> >      <plugin>
> >        <groupId>org.codehaus.mojo.jspc</groupId>
> >        <artifactId>jspc-maven-plugin</artifactId>
> >        <version>2.0-alpha-1</version>
> >        <executions>
> >          <execution>
> >            <goals>
> >              <goal>compile</goal>
> >            </goals>
> >          </execution>
> >        </executions>
> >        <dependencies>
> >          <dependency>
> >            <groupId>org.codehaus.mojo.jspc</groupId>
> >            <artifactId>jspc-compiler-tomcat5</artifactId>
> >            <version>2.0-alpha-1</version>
> >          </dependency>
> >        </dependencies>
> >        <configuration>
> >          <sources>
> >            <directory>${basedir}/src/main/resources/</directory>
> >            <includes>
> >              <include>**/*.jsp</include>
> >            </includes>
> >          </sources>
> >          <source>1.6</source>
> >          <target>1.6</target>
> >          <verbose>1</verbose>
> >        </configuration>
> >      </plugin>
> >
> >
> > Is there a way to do this? Currently I get following error when I try to build one of my JAR projects:
> >
> > [WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
> > [INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\jsp-source
> > [INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\classes
> > [INFO] Compiling JSP source files to C:\mycompany\project\COOLP\mycompany-common\target/jsp-source
> > [INFO] ------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO] ------------------------------------------------------------------------
> > [INFO] The -uriroot option must specify a pre-existing directory
> > [INFO] ------------------------------------------------------------------------
> > [INFO] Trace
> > org.apache.jasper.JasperException: The -uriroot option must specify a pre-existing directory
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: overriding jspc-maven-plugin

Posted by Wayne Fay <wa...@gmail.com>.
Many plugins offer a <skip> configuration option. Check the plugin
docs to see if jspc-m-p does, and if it does not, file a JIRA to
request that someone else add it or do it yourself. Then you could
simply add the plugin in the parent, and declare it with
<skip>true</skip> in the non-WAR children projects.

Wayne

On 11/26/07, Amir Mistric <am...@nemours.org> wrote:
> Hi
>
> I have a super-parent POM that all of my projects inherit...
> 90% of the projects are WAR files and few are multi module JARs....
>
> I would like to define a JSPC compile plugin at the super-parent POM level but the problem arises when building non-WAR projects....
>
> How can I "redefine" specific project's POMs (the ones that are JARs) not to "consider" JSPC plugin?
>
>
> The obvious solution is not to define jspc-maven-plugin at the super-parent POM level but in each project individually...
> But that means I have to specify something like this in multiple places which I am trying to avoid:
>
>      <plugin>
>        <groupId>org.codehaus.mojo.jspc</groupId>
>        <artifactId>jspc-maven-plugin</artifactId>
>        <version>2.0-alpha-1</version>
>        <executions>
>          <execution>
>            <goals>
>              <goal>compile</goal>
>            </goals>
>          </execution>
>        </executions>
>        <dependencies>
>          <dependency>
>            <groupId>org.codehaus.mojo.jspc</groupId>
>            <artifactId>jspc-compiler-tomcat5</artifactId>
>            <version>2.0-alpha-1</version>
>          </dependency>
>        </dependencies>
>        <configuration>
>          <sources>
>            <directory>${basedir}/src/main/resources/</directory>
>            <includes>
>              <include>**/*.jsp</include>
>            </includes>
>          </sources>
>          <source>1.6</source>
>          <target>1.6</target>
>          <verbose>1</verbose>
>        </configuration>
>      </plugin>
>
>
> Is there a way to do this? Currently I get following error when I try to build one of my JAR projects:
>
> [WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
> [INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\jsp-source
> [INFO] Created dir: C:\mycompany\project\COOLP\mycompany-common\target\classes
> [INFO] Compiling JSP source files to C:\mycompany\project\COOLP\mycompany-common\target/jsp-source
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] The -uriroot option must specify a pre-existing directory
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.jasper.JasperException: The -uriroot option must specify a pre-existing directory
>
>

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