1.使用svn 生成 补丁包文件
选择要生成补丁包的项目,右键-》 选择term -> 创建补丁包,
补丁包文件名为:2015-04-18-safe-patch.txt
2.解析补丁包文件,生成更新文件。
public class FreePatchUtil {
// 2015-02-26patch.txt
public static String patchFile = "E:/tjisoftstone/beijing_update/cbe_merchant_api/2015-04-18-safe-patch.txt";// 补丁文件,由eclipse
// svn
// plugin生成
public static String projectPath = "E:/tjisoftstone/tianjin_pay_new/cbe_merchant_api";// 项目文件夹路径
public static String webContent = "WebContent";// web应用文件夹名
public static String classPath = projectPath
+ "/WebContent/WEB-INF/classes";// class存放路径
public static String desPath = "E:/tjisoftstone/beijing_update/cbe_merchant_api";// 补丁文件包存放路径
public static String version = "2015-04-18-safe-patch";// 2015-04-1-chinapay-patch
// "2015-03-27-chinapay";//补丁版本
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
copyFiles(getPatchFileList());
// getPatchFileList();
}
public static List<String> getPatchFileList() throws Exception {
List<String> fileList = new ArrayList<String>();
FileInputStream f = new FileInputStream(patchFile);
BufferedReader dr = new BufferedReader(new InputStreamReader(f));
String line;
while ((line = dr.readLine()) != null) {
if (line.indexOf("Index:") != -1) {
line = line.replaceAll(" ", "");
line = line.substring(line.indexOf(":") + 1, line.length());
fileList.add(line);
}
}
return fileList;
}
public static void copyFiles(List<String> list) {
for (String fullFileName : list) {
if (fullFileName.indexOf("src/") != -1) {// 对源文件目录下的文件处理
// E:/tjisoftstone/dianpiao/dp_3_0/DraftManage-ebank/src/test/patch/FreePatchUtil.java
// String fileName=fullFileName.replace("src","");
int classStart = fullFileName.lastIndexOf("src");
String fileName = fullFileName.substring(classStart,
fullFileName.length()).replace("src", "");
fullFileName = classPath + fileName;
if (fileName.endsWith(".java")) {
fileName = fileName.replace(".java", ".class");
fullFileName = fullFileName.replace(".java", ".class");
}
String tempDesPath = fileName.substring(0, fileName
.lastIndexOf("/"));
String desFilePathStr = desPath + "/" + version
+ "/WebContent/WEB-INF/classes" + tempDesPath;
String desFileNameStr = desPath + "/" + version
+ "/WebContent/WEB-INF/classes" + fileName;
File desFilePath = new File(desFilePathStr);
if (!desFilePath.exists()) {
desFilePath.mkdirs();
}
System.out.print("fullFileName:" + fullFileName);
System.out.println("desFileNameStr:" + desFileNameStr);
copyFile(fullFileName, desFileNameStr);
System.out.println(fullFileName + "复制完成");
} else if (fullFileName.indexOf(".jsp") != -1) {// 对普通目录的处理
// jsp 页面复制
fullFileName = projectPath + "/" + fullFileName;
int start = fullFileName.lastIndexOf("WebContent");
String desFileName = fullFileName.substring(start, fullFileName
.length());
// String desFileName=fullFileName.replaceAll(webContent,"");
// fullFileName=projectPath+"/"+fullFileName;//将要复制的文件全路径
String fullDesFileNameStr = desPath + "/" + version + "/"
+ desFileName;
String desFilePathStr = fullDesFileNameStr.substring(0,
fullDesFileNameStr.lastIndexOf("/"));
File desFilePath = new File(desFilePathStr);
if (!desFilePath.exists()) {
desFilePath.mkdirs();
}
copyFile(fullFileName, fullDesFileNameStr);
System.out.println(fullDesFileNameStr + "复制完成");
} else {
System.out.println("无法解析:" + fullFileName);
int start = fullFileName.lastIndexOf("WebContent");
String desFileName = fullFileName.substring(start, fullFileName
.length());
fullFileName = projectPath + "/" + fullFileName;
System.out.println("无法解析:" + fullFileName);
String fullDesFileNameStr = desPath + "/" + version + "/"
+ desFileName;
String desFilePathStr = fullDesFileNameStr.substring(0,
fullDesFileNameStr.lastIndexOf("/"));
File desFilePath = new File(desFilePathStr);
if (!desFilePath.exists()) {
desFilePath.mkdirs();
}
copyFile(fullFileName, fullDesFileNameStr);
System.out.println("源地址:" + fullFileName + "----"
+ fullDesFileNameStr + "复制完成");
}
}
}
private static void copyFile(String sourceFileNameStr, String desFileNameStr) {
File srcFile = new File(sourceFileNameStr);
File desFile = new File(desFileNameStr);
try {
copyFile(srcFile, desFile);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void copyFile(File sourceFile, File targetFile)
throws IOException {
BufferedInputStream inBuff = null;
BufferedOutputStream outBuff = null;
try {
// 新建文件输入流并对它进行缓冲
inBuff = new BufferedInputStream(new FileInputStream(sourceFile));
// 新建文件输出流并对它进行缓冲
outBuff = new BufferedOutputStream(new FileOutputStream(targetFile));
// 缓冲数组
byte[] b = new byte[1024 * 5];
int len;
while ((len = inBuff.read(b)) != -1) {
outBuff.write(b, 0, len);
}
// 刷新此缓冲的输出流
outBuff.flush();
} finally {
// 关闭流
if (inBuff != null)
inBuff.close();
if (outBuff != null)
outBuff.close();
}
}
}
相关推荐
根据SVN补丁日志,自动生成补丁包,解决在JAVA开发时打补丁的麻烦。 注:此脚本仅针对JAVAWEB项目,其他种类也可自行更改
根据SVN补丁日志,自动生成补丁包,解决在JAVA开发时打补丁的麻烦。 注:此脚本仅针对JAVAWEB项目,其他种类也可自行更改
SVN安装文件及SVN中文补丁,相应的安装版本必须匹配相应的svn中文补丁
代码都是用svn来管理的,但是web项目基本上是...逼急了,自已用access写了一个管理,自动提取两个SVN版本之间的差异,并挑选需要发布的文件,按照目录结构生成patch包,到时将patch包直接拷到测试环境或生成环境即可。
用SVNKit制作的自动打包程序,根据SVN提交日志自动打包改动过的文件,制作升级补丁并生成更新日志。
通过svn提交日志查询筛选,导出选定的修改部分,生成增量补丁包
NULL 博文链接:https://zhangzhenting.iteye.com/blog/671043
1.项目使用方法: http://blog.csdn.net/w329636271/article/details/52083934 2.用于svn对比结果的打包
能够将Java代码自动生成补丁
java 写的根据svn信息生成的增量打包工具类,有部分路径和判断条件需要修改,修改正确后可直接执行main方法运行。
svn1.4.0.7501版本的中文补丁,安装svn1.4后运行该补丁,在svn settings 选项里选择语言为简体中文即可,因为文件上传限制,svn1.4单独上传,需要的查找我的其他资源
清楚svn目录下生成的.svn所有文件夹
用于修改SVN密码的工具,利用PHP方式实现密码修改,它适用于VisualSVN v3.9.x 64bit版本(实测3.9.1),...你唯一需要修改的是,htdocs文件里的pwd.php文件第3行和第4行,根据你安装路径和库文件路径修改,请放心使用,
根据SVN更新日志,结合eclispse/或其他IDE工具导出war包解压出来就是部署的目录结构了;再把开发的工具和解压的全量更新文件以及导出的SVN更新日志放在同级目录,利用插件把SVN更新日志的增量更新文件提取生成同部署...
是否遇到过公司里的sx向svn提交了不该提交的文件?.sdf debug release 等等,是否对此感到崩溃?!是否svn仓库已经占用了大量的磁盘空间? 使用本图形化工具帮助你将这些文件彻底地从svn中删除。 先导出svn仓库 ...
利用svnkit操作svn,实现对版本修改文件的导出,可以导出多个版本,.java文件将会在本地取出.class文件,导出后压缩成压缩包,主要用于服务器上的资源更新,不需要开发人员去找到对应的.class文件或其他文件压缩然后...
Svn 1.8.6汉化补丁包含32位和64位。
svn两个版本之间改动的文件列表 包括新增和更新的文件 用PYTHON写的脚本
从事了几年的工作之后,发现在部署服务的时候,总是需要将自己修改的源码编译后,才能放到Tomcat运行,每次修改的文件数量如果比较少(),这种情况下手工拷贝文件,大部分研发工作人员都还能接受;但是有时候开发...
svn修改