posts - 41, comments - 15, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          MyEclipse9.0集成SVN

          Posted on 2012-05-30 13:23 yuhaibo736 閱讀(2121) 評論(2)  編輯  收藏

          MyEclipse9.0與其他版本不一樣:


          1.首先下載svn的zip包:http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240


           
          我的是:site-1.6.18.zip


          2.將下載的包解壓,*.xml全部不要,只保留plugins和features兩個文件夾


          3.在任意位置建立文件夾,命名隨意,只要符合規范,將上面的兩個文件夾拷貝到剛才所建立的文件路徑下,我在E盤下建立如下路徑:E:\plugins\svn,plugins和features兩個文件夾放在svn下


          4.建立一個java程序:


          import java.io.File; 
          import java.util.ArrayList; 
          import java.util.List; 

          /**
          * MyEclipse9 插件配置代碼生成器
          *
          *
          */

          public class PluginConfigCreator 

              public PluginConfigCreator()

              public void print(String path) 
                  List<String> list = getFileList(path); 
                  if (list == null)
                      return; 
                  } 

                  int length = list.size(); 
                  for (int i = 0; i < length; i++)
                      String result = ""; 
                      String thePath = getFormatPath(getString(list.get(i))); 
                      File file = new File(thePath); 
                      if (file.isDirectory())
                          String fileName = file.getName(); 
                          if (fileName.indexOf("_") < 0)
                              print(thePath); 
                              continue; 
                          } 
                          String[] filenames = fileName.split("_"); 
                          String filename1 = filenames[0]; 
                          String filename2 = filenames[1]; 
                          result = filename1 + "," + filename2 + ",file:/" + path + "\\"  + fileName + "\\,4,false"; 
                          System.out.println(result); 
                      } else if (file.isFile()) 
                          String fileName = file.getName(); 
                          if (fileName.indexOf("_") < 0)
                              continue; 
                          } 
                          int last = fileName.lastIndexOf("_");// 最后一個下劃線的位置 
                          String filename1 = fileName.substring(0, last); 
                         String filename2 = fileName.substring(last + 1, fileName.length() - 4); 
                          result = filename1 + "," + filename2 + ",file:/" + path + "\\" + fileName + ",4,false"; 
                          System.out.println(result); 
                      } 
                  } 
              } 

              public List<String> getFileList(String path) 
                  path = getFormatPath(path); 
                  path = path + "/"; 
                  File filePath = new File(path); 
                  if (!filePath.isDirectory()) 
                      return null; 
                  } 
                  String[] filelist = filePath.list(); 
                  List<String> filelistFilter = new ArrayList<String>(); 
                  for (int i = 0; i < filelist.length; i++) 
                      String tempfilename = getFormatPath(path + filelist[i]); 
                      filelistFilter.add(tempfilename); 
                  } 
                  return filelistFilter; 
              } 

              public String getString(Object object) 
                  if (object == null) 
                      return ""; 
                  } 
                  return String.valueOf(object); 
              } 

              public String getFormatPath(String path) 
                  path = path.replaceAll("\\\\", "/"); 
                  path = path.replaceAll("http://", "/"); 
                  return path; 
              } 

              public static void main(String[] args) 
                  /*你的插件的安裝目錄*/
                      String plugin = "E:\\plugins\\svn";   //這里的目錄路徑要注意
                  new PluginConfigCreator().print(plugin); 
              } 
          }


          運行該程序,將生成的控制臺數據拷貝復制到bundles.info文件中,該文件的所在路徑是MyEclipse的安裝路徑,我采用的是默認路徑:


          D:\MyEclipse\MyEclipse-9.0M1\configuration\org.eclipse.equinox.simpleconfigurator


          最后重啟MyEclipse就可以使用SVN了


          評論

          # re: MyEclipse9.0集成SVN   回復  更多評論   

          2013-07-16 09:46 by 小米5
          不錯

          # re: MyEclipse9.0集成SVN   回復  更多評論   

          2013-09-22 16:36 by 路人某
          強??!受教了??!

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 淳安县| 巴楚县| 来安县| 柞水县| 永靖县| 九龙坡区| 乐都县| 松溪县| 乌拉特前旗| 宁蒗| 微博| 华安县| 安龙县| 彝良县| 洛扎县| 陇西县| 昌都县| 萨嘎县| 桂平市| 平昌县| 黑水县| 博爱县| 沙洋县| 扶余县| 浦东新区| 原平市| 武山县| 海南省| 柘荣县| 土默特右旗| 满城县| 米脂县| 临邑县| 乐东| 泸定县| 紫阳县| 读书| 辽宁省| 济南市| 英德市| 个旧市|