上往建站提供服务器空间服务商,百度快照排名,网站托管,百度推广运营,致力于设计外包服务与源代码定制开发,360推广,搜狗推广,增加网站的能见度及访问量提升网络营销的效果,主营:网站公司,百度推广公司电话,官网搭建服务,网站服务企业排名,服务器空间,英文域名等业务,专业团队服务,效果好。
【大丰网站建设|大丰网站制作|大丰网站设计】网站开发-网站改版-网站维护-网站搭建-网站托管-网站费用-网站价格-网站多少钱-网站报价

大丰区,江苏省盐城市市辖区,地处黄海之滨,江苏省东部、盐城市南部,东临黄海,西连兴化市,南与东台市接壤,北与盐城市亭湖区交界,总面积3059平方千米,辖2个街道、11个镇、两个省级开发区。
[32] 根据第七次人口普查数据,截至2020年11月1日零时,大丰区常住人口645603人
[35] 。
大丰于1942年5月始设县,1951年8月更名为大丰县。1996年8月撤销大丰县,设立县级大丰市。2015年8月,撤销县级大丰市,设立盐城市大丰区。
[1] 大丰是麋鹿故乡、黄海港城、上海“飞地”、革命老区、长寿之乡;入选全国综合实力百强区;先后获“全国首批生态建设示范市”、“国家首批可持续发展先进示范区”、“国家社会发展综合实验区”、“国家级卫生城市”、“中国优秀旅游城市”、“江苏省文明城市”、“江苏省卫生城市”、“江苏省园林城市”、“江苏省社会治安城市”、“全国城市环境综合整治优秀城市”、“中国最佳休闲小城”和“中国生态保护最佳湿地”。
[32] 是第二批国家农产品质量安全县。
[2] 2020年,大丰区实现生产总值686.78亿元,按可比价格计算,同比增长4.0%;第一产业增加值98.64亿元,增长2.7%;第二产业增加值224.61亿元,增长3.0%;第三产业增加值363.54亿元,增长4.9%。
2、通过Maven设置激活配置文件
打开 %USER_HOME%/.m2 目录下的 settings.xml 文件,其中 %USER_HOME% 代表用户主目录。如果 setting.xml 文件不存在就直接拷贝 %M2_HOME%/conf/settings.xml 到 .m2 目录,其中 %M2_HOME% 代表 Maven 的安装目录。
配置 setting.xml 文件,增加 <activeProfiles>属性:
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
... <activeProfiles>
<activeProfile>test</activeProfile>
</activeProfiles></settings>
执行命令:
mvn test
提示 1:此时不需要使用 -Ptest 来输入参数了,上面的 setting.xml 文件的 <activeprofile> 已经指定了 test 参数代替了。
提示 2:同样可以使用在 %M2_HOME%/conf/settings.xml 的文件进行配置,效果一致。
执行结果:

3、通过环境变量激活配置文件
先把上一步测试的 setting.xml 值全部去掉。
然后在 pom.xml 里面的 <id> 为 test 的 <profile> 节点,加入 <activation> 节点:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jsoft.test</groupId>
<artifactId>testproject</artifactId>
<packaging>jar</packaging>
<version>0.1-SNAPSHOT</version>
<name>testproject</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>test</id>
<activation>
<property>
<name>env</name>
<value>test</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Using env.test.properties</echo>
<copy file="src/main/resources/env.test.properties" tofile="${project.build.outputDirectory}/env.properties" overwrite="true"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>normal</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Using env.properties</echo>
<copy file="src/main/resources/env.properties" tofile="${project.build.outputDirectory}/env.properties" overwrite="true"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Using env.prod.properties</echo>
<copy file="src/main/resources/env.prod.properties" tofile="${project.build.outputDirectory}/env.properties" overwrite="true"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles></project>
执行命令:
mvn test -Denv=test
提示 1:上面使用 -D 传递环境变量,其中 env 对应刚才设置的 <name> 值,test 对应<value>。
提示 2:在 Windows 10 上测试了系统的环境变量,但是不生效,所以,只能通过 -D 传递。
执行结果:
【大丰网站建设|大丰网站制作|大丰网站设计】网站开发-网站改版-网站维护-网站搭建-网站托管-网站费用-网站价格-网站多少钱-网站报价
上往建站提供搭建网站,域名注册,官网备案服务,网店详情页设计,企业网店,专业网络店铺管理运营全托管公司咨询电话,服务器空间,微信公众号托管,网页美工排版,致力于域名申请,竞价托管,软文推广,全网营销,提供标准级专业技术保障,了却后顾之忧,主营:虚拟主机,网站推广,百度竞价托管,网站建设,上网建站推广服务,网络公司有哪些等业务,专业团队服务,效果好。
服务热线:400-111-6878 手机微信同号:18118153152(各城市商务人员可上门服务)