代码拉取完成,页面将自动刷新
安装如下步骤操作后,将得到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里修改
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。