本文介绍了jspc-maven-plugin不执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在pom.xml中添加了这样的jspc插件

I'm adding the jspc plugin like this in my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <groupId>org.codehaus.mojo.jspc</groupId>
               <artifactId>jspc-maven-plugin</artifactId>
               <version>2.0-alpha-3</version>
               <executions>
                  <execution>
                  <phase>compile</phase>
                     <goals>
                        <goal>compile</goal>
                     </goals>
                  </execution>
               </executions>
               <configuration>
                  <inputwebxml>${basedir}/src/main/webapp/WEB-INF/web.xml</inputwebxml>
                  <sources>
                     <directory>${basedir}/src/main/webapp/jsp</directory>
                     <includes>
                        <include>**/*.jsp</include>
                     </includes>
                  </sources>
               </configuration>
               <dependencies>
                  <dependency>
                     <groupId>org.codehaus.mojo.jspc</groupId>
                     <artifactId>jspc-compiler-tomcat6</artifactId>
                     <version>2.0-alpha-3</version>
                  </dependency>
               </dependencies>
            </plugin>
         </plugins>
      </pluginManagement>
   </build>
</project>

但是,当我运行mvn clean dependency:copy-dependencies install时,我看不到生成任何类.在这里, http: //hasini-gunasinghe.blogspot.com/2011/09/how-to-use-pre-compiled-jsps-in-webapp.html ,我应该看到一个target/jsp-source目录,但是我没有.

But, when I run mvn clean dependency:copy-dependencies install, I don't see any classes are generated. From here, http://hasini-gunasinghe.blogspot.com/2011/09/how-to-use-pre-compiled-jsps-in-webapp.html, I'm supposed to see a target/jsp-source directory, but I don't have it.

我的pom.xml有问题吗?

Any problem with my pom.xml?

推荐答案

问题是您在 <pluginManagement> ,并且未在<plugins>内部声明.引用Maven文档(重点是我的):

The problem is that you are declaring the plugin inside <pluginManagement> and it is not declared inside a <plugins>. Quoting Maven documentation (emphasis mine):

在这里不是这种情况.

这样,您只需要删除<pluginManagement>元素,然后直接在<plugins>内部声明插件即可.

As such, you just need to remove the <pluginManagement> element and let the plugin be declared directly inside <plugins>.

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo.jspc</groupId>
            <artifactId>jspc-maven-plugin</artifactId>
            <version>2.0-alpha-3</version>
            <!-- rest of configuration -->
        </plugin>
    </plugins>
</buil>

这篇关于jspc-maven-plugin不执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:37