背景:
原先开发的时候,需要 ant运行 copyResources target(deploy depend 该 target ) 来进行 native2ascii
开发过程中有时候会遗漏这个步骤,会发现 缺少相关 properties 文件
并且,原来的messages文件夹 是独立于src/main/resources 之外的,独立于maven管理系统,不利于tomcat/jetty插件的集成
解决:
将message文件夹移动到src/main/resources 目录
引入native2ascii-maven-plugin 插件 ,在 maven 生命周期(compile) 阶段 ,进行自动 native2ascii ,不需要额外的手工点击 ant target
原先的 copyResources target 删除
具体实现:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<id>native2ascii</id>
<phase>compile</phase>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>utf-8</encoding>
<includes>
<include>${native2ascii_pattern}</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
扩展知识:
还可以使用maven-antrun-plugin 插件,配置native2ascii来实现(缺点:会比较文件时间,需要额外配置先删除再native2ascii)
或者安装eclipse proper 插件,会自动转码(缺点:源文件native2ascii)
分享到:
相关推荐
maven-project-info-reports-plugin-2.2.jar
Native2ascii Maven插件 目标:比1.0-alpha-1和1.0-beta-1更好的版本,两者都不兼容且文档记录不充分如何在这里查看用法: : 还要注意以下问题: ://bugs.openjdk.java.net/browse/JDK-8074431-此插件不受影响,即使...
maven-project-info-reports-plugin-2.1.jar
maven-svn-revision-number-plugin-1.7.jar 资源共享,有需要其他jar包的可以在评论留言,看到后我会陆续上传。
mybatis-plus-generator-maven-plugin-v1.0.0依赖的pom.xml,用于mybatis-plus-generator-maven-plugin-1.0.0.jar本地仓库上传时依赖使用
009 maven插件spring-boot-maven-plugin
Maven使用tomcat8-maven-plugin插件
maven编译pentaho-big-data-plugin遇到的所有问题解决,pentaho6.0
在apache-maven-3.5.2/conf/setting.xml中加入以下配置即可解决 alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central junit junit Address/ ...
为了在项目中快捷方便的代码生成,将mybatis-plus-generator封装为了一个maven的插件`mybatis-plus-generator-maven-plugin。使用文档参考:https://blog.csdn.net/xiweiller/article/details/103072165
ascii2native-maven-plugin 将 ASCII 编码的文本文件转换为本机。 输出示例 [INFO] --- ascii2native-maven-plugin:1.4-SNAPSHOT:ascii2native (ascii2native) @ express-api --- [INFO] Ascii2Native: Process ...
maven-jetty-jspc-plugin-6.1.25-sources.jar
maven-project-info-reports-plugin-2.1.2.jar
maven-svn-revision-number-plugin-1.4.jar
maven-svn-revision-number-plugin-1.2.jar
maven-java-formatter-plugin-0.4.jar
maven-svn-revision-number-plugin-1.7-sources.jar
maven-dependency-versions-check-plugin-2.0.2-sources.jar
maven-project-info-reports-plugin-2.0.jar
在idea下使用maven的mybatis-generator-maven-plugin插件自动生成实体映射文件