gpt4 book ai didi

java - 使用 Maven 将 Grails 应用程序打包到 war

转载 作者:行者123 更新时间:2023-12-01 11:11:05 25 4
gpt4 key购买 nike

我有一个 grails 应用程序转换为 Maven 项目。

当我执行mvncompile时,我希望在目标文件夹中生成类文件,但我收到以下消息。

--- maven-compiler-plugin:3.1:compile (default-compile) @ sampleService --- [INFO] Nothing to compile - all classes are up to date

我的 pom.xml 中有以下代码片段。请帮忙

<build>
<sourceDirectory>grails-app</sourceDirectory>

<pluginManagement/>

<plugins>
<!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4</version>
<configuration>
<filesets>
<fileset>
<directory>plugins</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>

<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>2.4.4</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>clean</goal>
<goal>maven-war</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<attachClasses>true</attachClasses>
</configuration>
</plugin>

</plugins>
</build>

<repositories>
<repository>
<id>grails</id>
<name>grails</name>
<url>https://repo.grails.org/grails/core</url>
</repository>
<repository>
<id>grails-plugins</id>
<name>grails-plugins</name>
<url>https://repo.grails.org/grails/plugins</url>
</repository>
</repositories>

<profiles>
<profile>
<id>tools</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>

最佳答案

您有 Maven 文件夹结构,或者它的 grails-app 是否在 pom.xml 中提供了打包,如下所示

<packaging>grails-app<packaging>

关于java - 使用 Maven 将 Grails 应用程序打包到 war,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32367340/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com