1 Star 0 Fork 0

bbstone101 / e4-local-repo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

P2本地插件仓库(Update Site)

介绍

安装如下步骤操作后,将得到P2本地插件仓库: http://localhost/bbstone/updates/1.0

操作步骤

步骤1: 执行install-3rd-party-deps.sh脚本,将contrib目录下的依赖包安装到本地maven仓库 $ ./install-3rd-party-deps.sh

步骤2: 构建 p2 仓库站点,成功执行脚本./site.sh后可以通过以下命令查看到 构建的 p2本地插件库包括的插件

% tree -LD 2 target/repository

target/repository
├── [Feb 12 19:50]  artifacts.jar
├── [Feb 12 19:50]  category.xml
├── [Feb 12 19:50]  content.jar
└── [Feb 12 19:50]  plugins
    ├── [Feb 12 19:50]  au.com.cybersearch2.control_factory_1.2.0.jar
    ├── [Feb 12 19:50]  au.com.cybersearch2.statusbar_1.2.0.jar
    ├── [Feb 12 19:50]  ch.qos.logback.classic_1.2.3.jar
    ├── [Feb 12 19:50]  ch.qos.logback.core_1.2.3.jar
    ├── [Feb 12 19:50]  cn.bbstone.e4.ui.context_1.0.0.20230212194952.jar
    ├── [Feb 12 19:50]  cn.bbstone.e4.ui.log_1.0.0.20230212194952.jar
    ├── [Feb 12 19:50]  cn.bbstone.e4.ui.logpart_1.0.0.20230212194952.jar
    ├── [Feb 12 19:50]  cn.hutool.all_5.8.1.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.core.jackson-annotations_2.10.2.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.core.jackson-core_2.10.2.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.core.jackson-databind_2.10.2.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.datatype.jackson-datatype-jdk8_2.10.2.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.datatype.jackson-datatype-jsr310_2.10.2.jar
    ├── [Feb 12 19:50]  com.fasterxml.jackson.module.jackson-module-parameter-names_2.10.2.jar
    ├── [Feb 12 19:50]  com.google.gson_2.8.6.jar
    ├── [Feb 12 19:50]  com.opcoach.e4.preferences.mainmenu_1.3.1.jar
    ├── [Feb 12 19:50]  com.opcoach.e4.preferences_1.3.1.jar
    ├── [Feb 12 19:50]  com.twmacinta.fast-md5_2.7.1.jar
    ├── [Feb 12 19:50]  io.netty.all_4.1.42.Final.jar
    ├── [Feb 12 19:50]  org.apache.commons.collections_3.2.2.jar
    ├── [Feb 12 19:50]  org.apache.commons.commons-beanutils_1.9.4.jar
    ├── [Feb 12 19:50]  org.apache.commons.commons-codec_1.15.0.jar
    ├── [Feb 12 19:50]  org.apache.commons.configuration_2.2.0.jar
    ├── [Feb 12 19:50]  org.apache.commons.lang3_3.6.0.jar
    ├── [Feb 12 19:50]  org.apache.commons.logging_1.2.0.jar
    ├── [Feb 12 19:50]  slf4j.api_1.7.25.jar
    └── [Feb 12 19:50]  slf4j.api_1.7.30.jar

步骤3:启动jetty服务器 $ ./start.sh

步骤4: 在浏览器访问 p2 站点: http://localhost/bbstone/updates/1.0

/bbstone/updates/1.0 这部分请求路径,可以在pom.xml里修改

p2-maven-plugin插件相关信息(从官方网站摘录部分描述,完整信息访问p2-maven-plugin地址


https://github.com/reficio/p2-maven-plugin

Java vs. Maven vs. Eclipse RCP - dependency war
In order to add a third-party dependency to an Eclipse RCP project the dependency has to reside in a P2 update site.

Since Eclipse RCP is an OSGi environment in order to add a dependency to a p2 update site the dependency has to be an OSGi bundle (that is the problem number #2).


Best Practices
	
	DO NOT to use the Tycho's pomDependencies->consider option as it is simply of NO good
	
	DO NOT define your external dependencies in the dependencies section of the pom.xml (mvn compilation will work in the console, but it will 	not work in the Eclipse IDE when you import the project, since the 'Target Configuration' knows nothing about the dependencies defined there)
	
	Use the MANIFEST-FIRST approach - define all your dependencies in the MANIFEST.MF files.
	
	If some of your dependencies are not OSGi bundles or are not available in P2 update sites, SIMPLY define them in the p2-maven-plugin config, generate the site and make it available using jetty (or any other mechanism). Then add the URL of the exposed site to the target platform definition. In such a way you will have a consistent, manifest-first dependency management in Eclipse RCP project!
	
	Whenever you have to add another external dependency, simply re-invoke "mvn p2:site" and the site will be regenerated.

	You can automate the generation/exposition of our site using for example Jenkins and Apache2

	p2-maven-plugin will tweak the version of a snapshot dependency replacing the SNAPSHOT string with a timestamp in the following format "yyyyMMddHHmmss" (feature #14)

	It's possible to add a classifier to the artifact definition - supported notation: <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>; for example: <id>groupid:artifactid:jar:tests:version</id> (feature #28)

待办

1. 将contrib中jar的源码添加到项目,并整合到脚本,编译源码,安装到本地maven仓库。

2. 

MIT License Copyright (c) 2023 bbstone101 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Eclipse Local Repository for private share lib 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/bbstone101/e4-local-repo.git
git@gitee.com:bbstone101/e4-local-repo.git
bbstone101
e4-local-repo
e4-local-repo
master

搜索帮助