Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gradle 无法使用命令行参数启动spring启动应用程序_Gradle_Spring Boot - Fatal编程技术网

Gradle 无法使用命令行参数启动spring启动应用程序

Gradle 无法使用命令行参数启动spring启动应用程序,gradle,spring-boot,Gradle,Spring Boot,我在我的系统上设置了以下内容 Ubuntu 16.04 梯度3.0 Java 1.8.0_91 springBootVersion:1.4.0.0发行版 我使用以下参数从命令行运行spring引导应用程序 gradle-Dserver.port=8090-Dspring.profiles.active=dev bootRun 以下是日志 Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status fo

我在我的系统上设置了以下内容

  • Ubuntu 16.04
  • 梯度3.0
  • Java 1.8.0_91
  • springBootVersion:1.4.0.0发行版
  • 我使用以下参数从命令行运行spring引导应用程序

    gradle-Dserver.port=8090-Dspring.profiles.active=dev bootRun

    以下是日志

    Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details
    No active profile set, falling back to default profiles: default
    Registering beans for JMX exposure on startup
    2016-10-26 18:36:00.463  INFO 27743 --- [  restartedMain] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
    2016-10-26 18:36:00.584  INFO 27743 --- [  restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
    
    当我做gradle时,结果是

    No Gradle daemons are running.
       PID STATUS   INFO
     26929 STOPPED  (client disconnected)
     27086 STOPPED  (client disconnected)
     27202 STOPPED  (client disconnected)
     27367 STOPPED  (client disconnected)
    
    我不确定这里出了什么问题。我以前在spring boot和gradle的旧版本上运行过这个,没有任何问题

    但是当我这样做的时候

    java-jar-Dspring.profiles.active=dev-Dserver.port=8090 build/libs/demo-0.0.1-SNAPSHOT.jar

    我能够在端口8090和开发人员配置文件上使用所需参数运行应用程序。

    尝试使用:

    java-Dspring.profiles.active=dev-Dserver.port=8090-jar build/libs/demo-0.0.1-SNAPSHOT.jar

    的可能重复项