通过maven打包

<profiles>
        <profile>
            <id>dev</id>
            <!--<activation>-->
                <!--<activeByDefault>true</activeByDefault>-->
            <!--</activation>-->
            <properties>
                <environment>dev</environment>
            </properties>
        </profile>
        <profile>
            <id>test</id>
            <properties>
                <environment>test</environment>
            </properties>
        </profile>
        <profile>
            <id>prod</id>
            <properties>
                <environment>prod</environment>
            </properties>
        </profile>

    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>application-dev.properties</exclude>
                    <exclude>application-test.properties</exclude>
                    <exclude>application-prod.properties</exclude>
                    <exclude>application.properties</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>application-${environment}.properties</include>
                    <include>application.properties</include>
                </includes>
            </resource>
        </resources>
    </build>
</profiles>

在application.properties配置

## dev | prod | test
[email protected]@
时间: 2024-08-11 15:34:53

通过maven打包的相关文章

maven打包之新手拙见

maven打包一直都困扰着我这种新手,现在我也有点明白这是一个什么东西了.把maven打包问题总结一下. 首先配置好各种东西,能运行打包之后再细细研究一下这个打包的配置文件. pom.xml文件: 添加各种jar包引用不多讲了 下来是配置主类这个东西:pom.xml中添加<bulid> 内容如下: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-

maven 打包 java中的配置文件

转发地址 http://www.cnblogs.com/liuzy2014/p/5981824.html 一般情况下,我们用到的资源文件(各种xml,properites,xsd文件等)都放在src/main/resources下面,利用maven打包时,maven能把这些资源文件打包到相应的jar或者war里. 有时候,比如mybatis的mapper.xml文件,我们习惯把它和Mapper.java放一起,都在src/main/java下面,这样利用maven打包时,就需要修改pom.xml

利用Maven打包时,如何包含更多的资源文件

首先,来看下MAVENx项目标准的目录结构: 一般情况下,我们用到的资源文件(各种xml,properites,xsd文件等)都放在src/main/resources下面,利用maven打包时,maven能把这些资源文件打包到相应的jar或者war里. 有时候,比如mybatis的mapper.xml文件,我们习惯把它和Mapper.java放一起,都在src/main/java下面,这样利用maven打包时,就需要修改pom.xml文件,来把mapper.xml文件一起打包进jar或者war

hive udaf 用maven打包运行create temporary function 时报错

用maven打包写好的jar,在放到hive中作暂时函数时报错. 错误信息例如以下: hive> create temporary function maxvalue as "com.leaf.data.Maximum"; java.lang.SecurityException: Invalid signature file digest for Manifest main attributes at sun.security.util.SignatureFileVerifier

基于spring打包 maven 打包jar项目

J2EE项目开发 一般使用tomcat等servlet容器,有些自动化的任务却不需要放在servlet容器中, 把任务打包成jar会更方便部署 使用Maven打包Spring的jar包

Idea开发环境中搭建Maven并且使用Maven打包部署程序

1.配置Maven的环境变量 a.首先我们去maven官网下载Maven程序,解压到安装目录,如图所示: b.配置M2_HOME的环境变量,然后将该变量添加到Path中 备注:必须要有JAVA_HOME的M2_HOME环境变量,不然Maven会提示错误.配置环境变量如图所示: c.如果想要修改Maven的本地仓库位置,则可以直接在Maven的安装目录下找到conf文件下的setting配置文件中,设置localRepository为本地仓库位置 <localRepository>E:\java

Vcenter数据采集之maven打包可执行jar血历史

技术点:spring加载xsd过程: http://blog.csdn.net/bluishglc/article/details/7596118 案发背景: 1.一个使用maven管理的普通项目(vcenter-collector :关于Vcenter数据采集) 2.项目主要技术: java + mybatis(基于接口形式)+其他 3.项目中有一个非maven仓库的jar包:vijava(做vcenter数据采集的),在项目中以system方式引用 (该jar放在${project.base

maven打包步骤

maven打包1:先在pom文件中添加下面配置<build>        <plugins>            <!-- compiler插件, 设定JDK版本 -->            <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-compiler-plug

maven打包异常:软件包com.sun.org.apache.xml.internal.security.utils.Base64 不存在

maven打包异常:软件包com.sun.org.apache.xml.internal.security.utils.Base64 不存在 将jre/lib/rt.jar添加到maven的compiler里面  编译正常... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <versio

idea中用maven打包spring的java项目(非web)

之前一直用安装的maven打包spring的javaweb项目,用的是mvn assembly:assembly打包,这次打包非web的spring项目,遇到许多问题,特记录一下正确步骤. 1.配置pom.xml 这里不用assembly,因为assembly在打包时只会把第一次遇到的文件打入jar包,后面遇到的都会skip掉.也就是说assembly把我的Spring描述文件都忽略掉咯.报错就是:找不到 spring-context.xml (我的配置spring的xml),所以这里用 mav