gpt4 book ai didi

java - 无法创建 Grails 服务

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

从 IntelliJ Idea 版本 14 开始,在我的 Grails 应用程序(这是一个 Maven 项目)中,我这样做

右键单击“服务”->“新建”->“Grails 服务”

我的控制台上出现以下错误

插件 org.grails:grails-maven-plugin:2.4.4 需要 Maven 版本 3.1.0

当我从终端检查我的 Maven 版本时,它是 3.3

mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T17:27:37+05:30)
Maven home: /opt/software/apache-maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /opt/software/jdk1.7.0_79/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-61-generic", arch: "amd64", family: "unix"

Pom.xml(仅相关部分供引用)

<properties>
<grails.version>2.4.4</grails.version>
<h2.version>1.3.170</h2.version>
</properties>

<dependencies>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-dependencies</artifactId>
<version>${grails.version}</version>
<type>pom</type>
</dependency>


<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-test</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-testing</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>


<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<version>1.1</version>
<scope>compile</scope>


</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
<scope>compile</scope>


</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
<scope>runtime</scope>


</dependency>

<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-datastore-test-support</artifactId>
<version>1.0.2-grails-2.4</version>
<scope>test</scope>


</dependency>


<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>scaffolding</artifactId>
<version>2.1.2</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>cache</artifactId>
<version>1.1.8</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>asset-pipeline</artifactId>
<version>1.9.9</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>quartz</artifactId>
<version>1.0.2</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>rest</artifactId>
<version>0.8</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>excel-export</artifactId>
<version>0.2.1</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>grails-melody</artifactId>
<version>1.55.0</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>spring-security-core</artifactId>
<version>2.0-RC4</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>console</artifactId>
<version>1.5.1</version>
<scope>compile</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>hibernate4</artifactId>
<version>4.3.6.1</version>
<scope>runtime</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>database-migration</artifactId>
<version>1.4.0</version>
<scope>runtime</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
<scope>runtime</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>mail</artifactId>
<version>1.0.7</version>
<scope>runtime</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>tomcat</artifactId>
<version>7.0.55</version>
<scope>provided</scope>

<type>zip</type>

</dependency>

<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>webxml</artifactId>
<version>1.4.1</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<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.0</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>
</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>

最佳答案

您的 IntelliJ 正在使用捆绑的 Maven。

文件 > 设置(Ctrl+Alt+S),搜索 maven,然后将 Maven 主目录更改为终端中的目录。

关于java - 无法创建 Grails 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31851781/

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