我试图使用以下命令镜像Windows下的更新站点。
eclipsec -nosplash -verbose -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -writeMode clean -source http://download.eclipse.org/technology/m2e/releases/1.1/1.1.0.20120530-0009 -destination file:/C:/m2ecore
eclipsec -nosplash -verbose -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -writeMode clean -source http://download.eclipse.org/technology/m2e/releases/1.1/1.1.0.20120530-0009 -destination file:/C:/m2ecore这是可行的,但它下载了所有的工件两次,无论是规范形式还是打包形式。例如:
Mirroring: osgi.bundle,org.eclipse.m2e.editor.source,1.1.0.20120530-0009 (Descriptor: packed: osgi.bundle,org.eclipse.m2e.editor.source,1.1.0.20120530-0009)
Mirroring: osgi.bundle,org.eclipse.m2e.editor.source,1.1.0.20120530-0009 (Descriptor: canonical: osgi.bundle,org.eclipse.m2e.editor.source,1.1.0.20120530-0009)是否有一种方法可以指定我只想镜像规范形式?
有点像-filter (!format=packed)
我注意到artifacts.xml中有过滤器,p2应用程序似乎支持过滤器开关,只是文档很少。它看起来像LDAP查询,但在命令行中没有被识别。
如果无法过滤,我如何安全地修改本地回购以从元数据中删除打包的文件?手工编辑XML似乎不是个好主意。
编辑:以手动的方式完成了它。如果有人知道如何过滤以避免不必要的下载,那么这个问题就没有答案了。
转到C:\m2ecore,解压缩artifacts.jar,然后删除它。
编辑artifacts.xml中的属性部分
Remove the line <property name='publishPackFilesAsSiblings' value='true'/>
Adjust the properties size parameter (e.g: from 3 to 2)编辑artifacts.xml中的映射部分
Remove the line <rule filter='(& (classifier=osgi.bundle) (format=packed))' output='${repoUrl}/plugins/${id}_${version}.jar.pack.gz'/>
Remove the line <rule filter='(& (classifier=org.eclipse.update.feature) (format=packed))' output='${repoUrl}/features/${id}_${version}.jar.pack.gz'/>
Adjust the mappings size parameter (e.g.: from 5 to 3)删除所有打包的工件元数据
Use an editor with regex support to clear all matches of:
<artifact[\s]+[^>]*>(.(?!<[/]?artifact>))+Pack200Unpacker(.(?!<[/]?artifact>))+[\s]*</artifact>
To clear the blank lines, first regex replace with empty strings the matches of:
^[\s]*$
and then do an extended replace from \r\n\r\n to \r\n
Modify the total artifacts count by searching for matches of:
<artifact[\s]+[^>]*>将artifacts.xml压缩到artifacts.zip并将其重命名为artifacts.jar
从树中删除所有_*.pack.gz_文件。
发布于 2012-08-02 02:26:33
独立镜像应用程序功能有限,可以使用p2蚂蚁任务获取所需的东西。
https://stackoverflow.com/questions/11728322
复制相似问题