java - jspc-maven-plugin 没有执行?

标签 java maven

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

<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 目录,但我没有。

我的 pom.xml 有问题吗?

最佳答案

问题是您在 <pluginManagement> 中声明插件并且它没有在 <plugins> 中声明.引用 Maven 文档(强调我的):

Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one

这里不是这种情况。

因此,您只需删除 <pluginManagement>元素并让插件直接在 <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>

关于java - jspc-maven-plugin 没有执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34292102/

相关文章:

java - 使用 Quarkus 和 Resteasy 从主 Controller 外部访问路径参数

java - 即使我更改 Activity ,如何设置 MediaPlayer 始终处于 Activity 状态?

maven - GA 发布 Artifact akka-http 和 akka-streams 1.0 在哪里?

maven - QTP 到 Jenkins 集成帮助需要 CI

java - 应用程序无法使用类路径启动.../负匹配

java - Selenium如何通过元素id查找

java - 如何模拟 javax.mail.Session

java - 为什么我们在连接数据库时使用 Class.forName (“oracle.jdbc.driver.OracleDriver” )?

java - 如何在 Spring 配置的应用程序中使用 Maven 和各种 application.properties 生成不同测试区域的 Artifact

java - 运行 AppFuse 项目时出现错误 : "Failed to execute goal on project"