zoukankan      html  css  js  c++  java
  • spring-boot-dependencies jar 不完整的问题

    集成 springboot 有两种方式。

    1 直接 父项目指向  springboot 

      

    <parent>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-starter-parent</artifactId>
    		<version>2.0.3.RELEASE</version>
    	</parent>
    

      这种用起来很方便 ,默认打出的jar 也是完整的。

    2 使用  spring-boot-dependencie 

    <!-- springcloud -->
    	<dependencyManagement>
    		<dependencies>
    			
    			<dependency>
    				<groupId>org.springframework.boot</groupId>
    				<artifactId>spring-boot-dependencies</artifactId>
    				<version>2.0.3.RELEASE</version>
    				<type>pom</type>
    				<scope>import</scope>
    			</dependency>
    		</dependencies>
    	</dependencyManagement>
    

      这种默认打出的jar包是不完整的。 不能直接运行。

    加入下面的配置就可以了

    	<build>
    	    <plugins>
    	        <plugin>
    	            <groupId>org.springframework.boot</groupId>
    	            <artifactId>spring-boot-maven-plugin</artifactId>
    	            <configuration>
    	                <mainClass>com.sbl.pay.subaccount.SubaccountServerRunner</mainClass>
    	            </configuration>
    	            <executions>
    	                <execution>
    	                    <goals>
    	                        <goal>repackage</goal>
    	                    </goals>
    	                </execution>
    	            </executions>
    	        </plugin>
    	    </plugins>
    	</build>
    

      

    第二种麻烦一点,但是我们可以使用自己的父类。

  • 相关阅读:
    寒假学习报告05
    寒假学习报告04
    微信推送信息,支付宝支付接口
    Vue组件生成依赖文件,contentype
    redis之列表字典操作
    drf版本控制redis基础
    drf分页器,url控制器,解析器,响应器
    drf认证权限频率
    drf视图认证组件
    drf序列化组件
  • 原文地址:https://www.cnblogs.com/cxygg/p/9559618.html
Copyright © 2011-2022 走看看