1. 程式人生 > >The requested profile "test" could not be activated because it does not exist.

The requested profile "test" could not be activated because it does not exist.

SpringBoot專案在執行mvn install命令時出現以下問題:

[WARNING] The requested profile "test" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:repackage (default) on project mobile: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3
.3.RELEASE:repackage failed: Unable to find main class -> [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/PluginExecutionException

由repackage failed: Unable to find main class可以發現是沒找到主類。
但事實是SpringBoot的啟動類是已經寫好了的。
錯誤原因:
在SpringBoot描述的包中存在其它的帶有main方法的類。
刪除main方法即可以解決以上問題。

相關推薦

The requested profile "test" could not be activated because it does not exist.

SpringBoot專案在執行mvn install命令時出現以下問題: [WARNING] The requested profile "test" could not be activated

[WARNING] The requested profile "pom.xml" could not be activated because it does not exist.解決方法

版權宣告:本文為博主原創文章,未經博主允許不得轉載。https://blog.csdn.net/zhangleiyes123/article/details/82665702 (1).之前專案打包都OK,不知道咋回事,突然出現如下圖的問題: (2).上網查找了好多,一直沒有解決,最後把

WCF The service cannot be activated because it does not support ASP.NET compatibility

測試釋出到虛擬目錄中時發生的報錯現象,由於不支援asp.net相容性而導致服務無法啟用啟用。具體錯誤資訊如下:Server Error in '/Service2' Application. ------------------------------------------

Springboot The requested profile "pom.xml" could not be activated because it doesn't not exists

後來 close vat 配置 cau activate pre 很多 pes 頭一次寫springboot項目,打成war包時,pom.xml也都配置了,網上查了很多資料說是maven環境和java環境的問題,但是看了後沒有發現什麽問題,刪了maven下的.m2maven

java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist

java ... mod ons exc pen 方法 except open java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist

解決CXF的java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist

div light bst thread ast host ava ref off   以下是錯誤信息 九月 25, 2017 8:22:04 下午 org.springframework.web.context.support.XmlWebApplicationCont

SSM框架出現:class path resource [SpringMvc.xml] cannot be opened because it does not exist

def 文件 ati XML tco character java style cte 錯誤:class path resource [config/spring/springmvc.xml] cannot be opened because it does not exi

Maven 構建SSM架構是出現的異常:class path resource [mapper/*.xml] cannot be opened because it does not exist

異常資訊:  [INFO] Root WebApplicationContext: initialization started [WARNING] Exception encountered during context initialization - cancelling r

springboot activiti 報錯cannot be opened because it does not exist

Failed to process import candidates for configuration class [com.example.ActivitiApplication]; nested exception is java.io.FileNotFoundException: clas

報錯:java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist

配置spring是出現的問題: java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist    初學Spring在用Res

【錯誤解決】[Maven] cannot be opened because it does not exist錯誤[檔案無法編譯到target目錄下的解決方法]

使用IDEA搭建的Maven專案,在寫SpringEL和資源呼叫時出現瞭如下錯誤: 相信我,程式碼沒問題的、 Caused by: java.io.FileNotFoundException: class path resource [cn/hncu

class path resource [spring.xml] cannot be opened because it does not exist

    使用maven建立web工程,將spring配置檔案applicationContext.xml放在src/resource下,用Myeclipse編譯時提示class path resource [applicationContext.xml] cannot

class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist

如圖所示,錯誤就是找不到那個service.xml 但是仔細找找,那個檔案確確實實躺在那兒的。 那是什麼原因了,別人告訴我這個要看Class path。 System.getProperty("java.class.path") 用這個

IDEA Junit FileNotFoundException: class path resource [spring/spring.xml] cannot be opened because it does not exist

tst clas 指定 -- init project eclipse 分享 圖片 今天打算寫一個單元測試,但是已經有寫好的單元測試無論怎麽弄都提示文件不存在,自己一度以為是啟動方式不正確.這裏簡單記錄一下處理過程 1 異常信息: Caused by: org.sp

ueditor百度富文字編輯器linux下報錯: class path resource [config.json] cannot be resolved to absolute file path because it does not reside in the file system

具體報錯資訊如下 java.io.FileNotFoundException: class path resource [config.json] cannot be resolved to absolute file path because it does not reside in the fi

The file can not be loaded because it was created for another build target that is not compatible wi

03-23 14:35:05.274: E/Unity(5354): The file can not be loaded because it was created for another build target that is not compatible with this platfor

cannot be resolved to absolute file path because it does not reside in the file system

使用maven分模組元件專案的時候,domain中的實體的*.hbm.xml檔案不能被spring掃描到,因為聚合的時候核心包已經達成jar包了,所以要去jar中去找hbm.xml檔案 <!--注入sessionFactory -->     <bea

Hololens錯誤提示:can't be loaded because it was not built with the right version or build target.

說明: hololens在使用assetbundle進行聯網下載資源時報錯: The file can not be loaded because it was created for another

Invalid 'log4jConfigLocation' parameter: class path resource [log4j.xml] cannot be resolved to URL because it does not exist

cau 是否 大堆 class not tomcat cati gpo div 有一天手賤,無意間把eclipse中項目刪了,重新從svn上拉代碼,然後在導進eclipse,啟動Tomcat,報錯 Invalid ‘log4jConfigLocation‘ paramete

class path resource [logback.xml] cannot be resolved to URL because it does not exist 問題解決

今天在自己搭建Springboot 框架的時候,在配置 logging.config=classpath:logback.xml 出現找不到這個檔案的錯誤 經發現是maven的一個寫法問題,本來我是打算打算替換 .properties檔案中的內容,後面啟動的時候報錯,發現主要原因是 mavne