1. 程式人生 > 其它 >smc.jar中沒有主清單屬性

smc.jar中沒有主清單屬性

技術標籤:錯誤java

smc.jar中沒有主清單屬性

問題解決。

pom上加入這段
下面展示一些 內聯程式碼片

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.4.RELEASE</version>
                <configuration>
                    <mainClass>cn.SoapSpringBootApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

cn.SoapSpringBootApplication 是主啟動類路徑 如果有倆個主啟動類的情況下使用

打完jar後發現報這個錯誤
下面展示一些 內聯程式碼片

2020-12-15 13:53:58.069  WARN 20248 --- [           main] 
ConfigServletWebServerApplicationContext : Exception encountered during context 
initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'authController': Injection of resource dependencies failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'huaWeiSMC': Injection of autowired dependencies failed; nested exception is 
java.lang.IllegalArgumentException: Could not resolve placeholder 'huaweiServer.ip' in 
value "${huaweiServer.ip}"

初始化bean錯誤 讀取不到yml的資料

**

解決方法

**
maven Lifecycle
clean 一下
執行專案
這時候會發現能跑起來了 ,打包也不會報錯了

注意!!! 不要clean 後立馬打包 必須跑一邊專案保證不報錯有target
在打包