[英]Spring Boot Jersey - Missing EmbeddedServletContainerFactory when running java -jar command
[英]Spring Boot Missing Plugin when Running from Command Line
我有一個可以在Eclipse中運行的Maven項目,但無法從Linux命令行運行它。 運行'mvn spring-boot:run'時出現錯誤:
“在存儲庫中未找到當前項目和插件組[org.apache.maven.plugins,org.codehaus.mojo]中前綴為'spring-boot'的插件”
這是我的POM:
<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>com.example</groupId>
<artifactId>project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<arguments>
<argument>--spring.profiles.active=prod</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
我最終使用完整的命令“ mvn org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:run”,當我從包含pom.xml文件的目錄中運行該命令時,由於某種原因,該命令可以工作。
您是否嘗試過從jar運行應用程序? 如果您正在使用作為解釋春天啟動的Maven插件在這里 ,你應該能夠只是java -jar your-jar-file.jar
,無需使用Maven。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.