zoukankan      html  css  js  c++  java
  • pom打包参数选择

    pom.xml配置

    <profiles>
    	<profile>
    		<id>dev</id>
    			<properties>
    				<token>dev</token>
    			</properties>
            <!-- 默认打包参数 -->
                        <activation>
    				<activeByDefault>true</activeByDefault>
    			</activation>
    	</profile>
    	<profile>
    		<id>test</id>
    			<properties>
    				<token>test</token>
    			</properties>
    	</profile>
    </profiles>
    
     <build>
    <!-- 开启资源配置--> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build>

      

    test.properties

    token=${token}
    

      *.java // 获取参数的java类

    public class TokenTestPom {
    	
    	private static ResourceBundle resource = ResourceBundle.getBundle("token");
    	
    	public static final String TOKEN=  resource.getString("token");
    	
    
    }
    

      

    项目打包命令:

     mvn install   -Ptest

  • 相关阅读:
    最短Hamilton路径-状压dp解法
    泡芙
    斗地主
    楼间跳跃
    联合权值
    虫食算
    抢掠计划
    间谍网络
    城堡the castle
    【模板】缩点
  • 原文地址:https://www.cnblogs.com/tietazhan/p/6689604.html
Copyright © 2011-2022 走看看