maven 定义profile.properties
2015-12-17 16:30
369 查看
生产项目部署,需要把war包中的properties 放到指定路径中,maven 可以指定profile.properties 路径<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profile.properties>properties</profile.properties>
<profile.product>false</profile.product>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<profile.properties>profiles/${project.artifactId}/properties</profile.properties>
<profile.product>true</profile.product>
</properties>
</profile>
</profiles>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
创建配置文件所在的文件夹/tomcat/profiles/scout-server/properties
打开 tomcat安装目录\bin\setenv.sh,增加 CLASSPATH=/tomcat/:$CLASSPATH:
jenkins 打包输入命令 -Pproduct 即可指定生产环境的路径
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profile.properties>properties</profile.properties>
<profile.product>false</profile.product>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<profile.properties>profiles/${project.artifactId}/properties</profile.properties>
<profile.product>true</profile.product>
</properties>
</profile>
</profiles>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
创建配置文件所在的文件夹/tomcat/profiles/scout-server/properties
打开 tomcat安装目录\bin\setenv.sh,增加 CLASSPATH=/tomcat/:$CLASSPATH:
jenkins 打包输入命令 -Pproduct 即可指定生产环境的路径
相关文章推荐
- 如何从Apache官网下载windows版apache服务器
- linux 下防火墙iptables
- linux下who am i和whoami的区别
- centos安装图形化界面 和 安装火狐浏览器
- 【Linux 驱动】中断处理(二)下半部tasklet
- 理解nginx的配置
- Linux下国际化问题
- CentOS6.6下DHCP服务器配置
- Linux指令--rm, rmdir
- Nginx的配置文件
- Linux指令--rm, rmdir
- Nginx下WordPress的Rewrite
- MapReduce-TopK
- shell脚本中导入mysql数据&&执行mysql语句
- Linux增加swap空间
- Tomcat中的线程池原理(APR和ThreadPool)
- AES加密解密Windows下跟linux下结果不同的解决方案
- linux命令行下利用postfix发送电子邮件
- 【转】使用ActivityManager的forceStopPackage方法结束进程
- 文件读写NDK(或Linux)