gpt4 book ai didi

java - Maven 命令 "mvn clean jetty:run"和其他 mvn 命令在 Eclipse 中不起作用

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

我正在关注 Google Cloud 文档 https://cloud.google.com/appengine/docs/flexible/java/using-cloud-sql用于开发应用程序。根据文档的建议,应使用 mvn clean jetty:run 命令在本地测试应用程序。除此之外,我也尝试过其他命令,例如 mvncompile 。以下是我在本地测试应用程序时遵循的步骤:-

右键单击我的项目 -> 运行方式 -> Maven 构建,然后启动配置框,我在其中输入 mvn clean jetty:在“目标”文本框中运行,然后单击“运行”

以下是我的 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>LiveInBliss</groupId>
<artifactId>LiveInBliss</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<!-- [START resources] -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<!-- [END resources] -->
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.0.M0</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.2.v20170220</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.1</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>1.34.0</version>
</dependency>
<dependency> <!-- http://dev.mysql.com/doc/connector-j/en/ -->
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory-connector-j-6</artifactId>
<version>1.0.10</version>
</dependency>
</dependencies>
<properties>
<!--
INSTANCE_CONNECTION_NAME from Cloud Console > SQL > Instance Details > Properties
or `gcloud sql instances describe <instance> | grep connectionName`
-->
<INSTANCE_CONNECTION_NAME>live-in-bliss:northamerica-northeast1:liveinbliss-99</INSTANCE_CONNECTION_NAME>
<user>root</user>
<password>my_password</password>
<database>liveinbliss</database>
<sqlURL>jdbc:mysql://google/$liveinbliss?cloudSqlInstance=$live-in-bliss:northamerica-northeast1:liveinbliss-99&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory&amp;user=$root&amp;password=$Mohini24&amp;useSSL=false</sqlURL>
</properties>

</project>

以下是我的错误日志:-

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< LiveInBliss:LiveInBliss >-----------------------
[INFO] Building LiveInBliss 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.305 s
[INFO] Finished at: 2018-10-08T18:28:24+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "mvn". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

请提出建议,我应该做哪些改变。

谢谢

最佳答案

仅输入clean jetty:run,删除mvn。

关于java - Maven 命令 "mvn clean jetty:run"和其他 mvn 命令在 Eclipse 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52703089/

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