不是很明白, 为什么 superdesk-app
是这个mvn package -Dmaven.test=skip
, 实际上也可以直接在pom文件中声明跳过测试
Maven编译插件及打包插件以及跳过测试插件, 参考:https://deepmind.t-salon.cc/article/3010
mvn package
mvn package -Dmaven.test=skip
而 superdesk-app-transfer
, 参考https://deepmind.t-salon.cc/article/3009
mvn clean package -Dmaven.test.skip=true
[env][已经修正为这个了]
mvn clean package -Dmaven.test.skip=true -P prod
是因为有 maven-surefire-plugin
这个插件吗
[INFO] Building superdesk-app-transfer-old2new 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ superdesk-app-transfer-old2new ---
[INFO] Deleting /mnt1t/JAVA_HOME/superdesk-app-transfer/superdesk-app-transfer-old2new/target
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ superdesk-app-transfer-old2new ---
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ superdesk-app-transfer-old2new ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 44 source files to /mnt1t/JAVA_HOME/superdesk-app-transfer/superdesk-app-transfer-old2new/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ superdesk-app-transfer-old2new ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ superdesk-app-transfer-old2new ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ superdesk-app-transfer-old2new ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ superdesk-app-transfer-old2new ---
[INFO] Building jar: /mnt1t/JAVA_HOME/superdesk-app-transfer/superdesk-app-transfer-old2new/target/superdesk-app-transfer-old2new.jar
[INFO] ------------------------------------------------------------------------
mvn clean package -pl superdesk-libs-mybatis --also-make -Dmaven.test.skip=true
mvn clean
mvn clean deploy -P snapshot -DskipTests=true
mvn clean deploy -P release -DskipTests=true
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.jdk.version}</source>
<target>${compiler.jdk.version}</target>
<encoding>${output.encoding}</encoding>
</configuration>
</plugin>
<!-- 打包时打不打源代码上去 -->
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-source-plugin</artifactId>-->
<!--<version>2.4</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>attach-sources</id>-->
<!--<phase>verify</phase>-->
<!--<goals>-->
<!--<goal>jar-no-fork</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
mvn dependency:analyze
mvn dependency:analyze >> /mnt1t/superdesk-app-dependency-analyz.log
mvn -Dverbose dependency:tree
mvn -Dverbose dependency:tree >> /mnt1t/superdesk-app-dependency-tree.log
添加 profiles 配置节
<project>
...
<profiles>
<profile>
<!-- 本地开发环境 -->
<id>dev</id>
<properties>
<profiles.active>dev</profiles.active>
</properties>
<!--默认启用的是dev环境配置-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<!-- 测试环境 -->
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
</properties>
</profile>
<profile>
<!-- UAT环境 -->
<id>uat</id>
<properties>
<profiles.active>uat</profiles.active>
</properties>
</profile>
<profile>
<!-- 生产环境 -->
<id>prod</id>
<properties>
<profiles.active>prod</profiles.active>
</properties>
</profile>
</profiles>
</project>
# 从原来的写死
spring.profiles.active=dev
# 改成读变量
spring.profiles.active=@profiles.active@
# 从原来的这样
mvn clean package -Dmaven.test.skip=true
# 指定 profile id 为 prod
mvn clean package -Dmaven.test.skip=true -P prod
java -Xms512m -Xmx1024m -jar superdesk-app-transfer-canal-instance-supercloud.jar
在Run Dashboard 添加
Active profiles dev
设置 为 pom.xml 上 profiles profile id
Override parameters
spring.profiles.active dev
(application-prod.properties) => prod
(application-test.properties) => test
(application-uat.properties) => uat
(application-dev.properties) => dev
未标明原创文章均为采集,版权归作者所有,转载无需和我联系,请注明原出处,南摩阿彌陀佛,知识,不只知道,要得到
最新评论