当前位置: 首页 > news >正文

网站纯色背景图怎么做郴州网站建设哪里比较好

网站纯色背景图怎么做,郴州网站建设哪里比较好,昆明小程序开发报价,wordpress最底部版權基于Maven构建OSGI应用。 使用Maven来构建项目#xff0c;包括项目的创建、子模块buldle的创建等。使用OSGI来实现动态模块化管理#xff0c;实现模块的热插拔效果#xff08;即插即用#xff09;。 创建一个Maven项目#xff1a;helloworld#xff0c;并在该项目下创建…基于Maven构建OSGI应用。 使用Maven来构建项目包括项目的创建、子模块buldle的创建等。使用OSGI来实现动态模块化管理实现模块的热插拔效果即插即用。 创建一个Maven项目helloworld并在该项目下创建两个Maven 子模块helloworld-client、helloworld-server。 创建 helloworld maven项目、填写参数及Advanced Settings 创建 helloworld-server maven子模块 同样的方式再创建 helloworl-client maven 子模块。 接下来就是 hellworld-server、helloworld-client 编码以及OSGI及编译打包配置。 OSGI及编译打包配置直接通过修改3个pom文件1个主pom、2个子模块的pom来配置最终配置结果如下 1代码结构 client-Activator.java package com.xxx.osgi.helloworld.client;import com.xxx.osgi.helloworld.server.HelloWorldImpl; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference;import java.util.Objects;/*** author frank* date 2023/12/8*/ public class Activator implements BundleActivator {public void start(BundleContext bundleContext) throws Exception {System.out.println(helloworld-client: start);System.out.println(helloworld-client: call server getHelloMsg());ServiceReferenceHelloWorldImpl reference bundleContext.getServiceReference(HelloWorldImpl.class);if (Objects.nonNull(reference)) {HelloWorldImpl service bundleContext.getService(reference);if (Objects.nonNull(service)) {String msg service.getHelloMsg(Frank);System.out.println(SUCCESS: return msg is:\n msg);} else {System.out.println(ERROR: service not found!);}bundleContext.ungetService(reference);} else {System.out.println(ERROR: service reference not found!);}}public void stop(BundleContext bundleContext) throws Exception {System.out.println(helloworld-client: stop);} } server-Activator.java package com.xxx.osgi.helloworld.server;import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference;import java.util.Dictionary; import java.util.Hashtable; import java.util.Objects;/*** author frank* date 2023/12/9*/ public class Activator implements BundleActivator {public void start(BundleContext bundleContext) throws Exception {System.out.println(helloworld-server: start);HelloWorldImpl server new HelloWorldImpl();DictionaryString, Object properties new HashtableString, Object();bundleContext.registerService(HelloWorldImpl.class, server, properties);System.out.println(helloworld-server: 服务已发布(注册)!);}public void stop(BundleContext bundleContext) throws Exception {System.out.println(helloworld-server: stop);} } server-IHelloWorld.java package com.xxx.osgi.helloworld.server;/*** author frank* date 2023/12/9*/ public interface IHelloWorld {String getHelloMsg(String name); } server-HelloWorldImpl.java package com.xxx.osgi.helloworld.server;/*** author frank* date 2023/12/9*/ public class HelloWorldImpl implements IHelloWorld {public String getMethodName() {return [ Thread.currentThread().getStackTrace()[2].getMethodName() : Thread.currentThread().getStackTrace()[2].getLineNumber() ] ;}public String getHelloMsg(String name) {return getMethodName() HelloWorld name;} } 2主pom project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.xxx.osgi/groupIdartifactIdhelloworld/artifactIdversion1.0.0-SNAPSHOT/versionmodulesmodulehelloworld-client/modulemodulehelloworld-server/module/modulespackagingpom/packagingnamehelloworld/nameurlhttp://maven.apache.org/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncodingmaven.compiler.source8/maven.compiler.sourceparent.maven.bundle.plugin.version2.4.0/parent.maven.bundle.plugin.version/propertiesdependenciesdependencygroupIdjunit/groupIdartifactIdjunit/artifactIdversion3.8.1/versionscopetest/scope/dependencydependency!-- 该版本 maven 仓库找不到如果要用该版本可以在 Project Structure-Project Settings-Modules 中设置--!-- 设置 OSGI:General-Configure OSGI Core Library-Use Library 指定本地 jar 文件静态添加 osgi lib --!--groupIdorg.eclipse/groupIdartifactIdosgi/artifactIdversion3.18.600.v20231110-1900/versionscopeprovided/scope--!-- 该版本maven仓库可以找到可以用这个版本。在 pom 中指定 osgi lib 的 dependency 依赖 --groupIdorg.eclipse/groupIdartifactIdosgi/artifactIdversion3.10.0-v20140606-1445/versionscopeprovided/scope/dependency/dependencies /project 3hellworld-client 子模块pom project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdparentartifactIdhelloworld/artifactIdgroupIdorg.xxx.osgi/groupIdversion1.0.0-SNAPSHOT/version/parentmodelVersion4.0.0/modelVersionartifactIdhelloworld-client/artifactIdpackagingbundle/packagingnamehelloworld-client/nameurlhttp://maven.apache.org/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependencies!-- osgi lib 使用主 pom 中定义的依赖子模块不再重复定义 osgi lib dependency --dependencygroupIdorg.xxx.osgi/groupIdartifactIdhelloworld-server/artifactIdversion${project.version}/version/dependency/dependenciesbuildpluginsplugin!-- osgi 打包配置使用 maven-bundle-plugin 插件进行 osgi 打包 bundle jar --!-- 使用maven-bundle-plugin打包方式时指定manifest文件不生效但可在 instructions 中配置 manifest 参数 --groupIdorg.apache.felix/groupIdartifactIdmaven-bundle-plugin/artifactIdversion${parent.maven.bundle.plugin.version}/versionextensionstrue/extensionsconfigurationinstructions!-- 如果要把依赖的 jar 也一起打包进去在 Import-Package 中指定、并设置 Embed-Dependency --!-- Embed-Dependency*;scopecompile|runtime/Embed-Dependency --Bundle-Name${project.name}/Bundle-NameBundle-SymbolicName$(replace;${project.artifactId};-;_)/Bundle-SymbolicNameBundle-Version${project.version}/Bundle-VersionBundle-Activatorcom.xxx.osgi.helloworld.client.Activator/Bundle-ActivatorImport-Packageorg.osgi.framework,com.xxx.osgi.helloworld.server;version${project.version}/Import-PackageExport-Packagecom.xxx.osgi.helloworld.client;version${project.version}/Export-Package/instructions/configuration/plugin/plugins/build /project4helloworld-server 子模块pom project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdparentartifactIdhelloworld/artifactIdgroupIdorg.xxx.osgi/groupIdversion1.0.0-SNAPSHOT/version/parentmodelVersion4.0.0/modelVersionartifactIdhelloworld-server/artifactIdpackagingbundle/packagingnamehelloworld-server/nameurlhttp://maven.apache.org/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncoding/propertiesdependencies!-- osgi lib 使用主 pom 中定义的依赖子模块不再重复定义 osgi lib dependency --/dependenciesbuildpluginsplugin!-- osgi 打包配置使用 maven-bundle-plugin 插件进行 osgi 打包 bundle jar --!-- 使用maven-bundle-plugin打包方式时指定manifest文件不生效但可在 instructions 中配置 manifest 参数 --groupIdorg.apache.felix/groupIdartifactIdmaven-bundle-plugin/artifactIdversion${parent.maven.bundle.plugin.version}/versionextensionstrue/extensionsconfigurationinstructions!-- 如果要把依赖的 jar 也一起打包进去在 Import-Package 中指定、并设置 Embed-Dependency --!-- Embed-Dependency*;scopecompile|runtime/Embed-Dependency --Bundle-Name${project.name}/Bundle-NameBundle-SymbolicName$(replace;${project.artifactId};-;_)/Bundle-SymbolicNameBundle-Version${project.version}/Bundle-VersionBundle-Activatorcom.xxx.osgi.helloworld.server.Activator/Bundle-ActivatorImport-Packageorg.osgi.framework/Import-PackageExport-Packagecom.xxx.osgi.helloworld.server;version${project.version}/Export-Package/instructions/configuration/plugin/plugins/build /project注意 iOSGI框架OSGI Library通过pom配置后自动manve刷新就可以自动在 Project Settings- Modules 中自动生成 OSGI 配置了包括OSGI Library也自设置了这里无需手动修改其他OSGI配置默认即可。根据pom自动生成的OSGI配置如下 Configure OSGI Core Library 点击打开显示如下 版本号就是pom中指定OSGI dependency 的版本。 iipom文件中配置打包插件使用maven-bundle-plugin 插件该插件是专门为OSGI打包提供的插件但是它不能导出 META-INF 中的内容到 Export-Package jar 包中。也就是说使用 maven-bundle-plugin 插件打包导出的 bundle jar 包中的 manifest 只能通过 pom.xml 文件中的 maven-bundle-plugin 打包参数项来配置不能直接指定使用自己项目中指定的 manifest 文件指定了也不生效。另外Project Settings - Modules 中的 Manifest Generation 配置也没有用。 另外maven-bundle-plugin 打包插件支持了一个标签 Embed-Dependency*;scopecompile|runtime/Embed-Dependency 有了这个标签可以直接把依赖的 jar 打入 bundle jar 包中去。注意这种方式仅对第三方依赖dependency有效例如 pom 中j加入 mysql-connector-java 驱动依赖 dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdversion8.0.15/version /dependency 打包生成的bundle jar包中查看内容jar tf xxx.jar只要配置了 Embed-Dependency对于 dependency定义的第三方依赖都会打入目标bundle jar包中直接把依赖的 mysql-connector-java-8.0.15.jar 文件导入进去了位于根目录下 但是对于本地Lib库文件例如下面这种依赖方式Embed-Dependency 则无效不会把 test-common-1.0.0.jar 打入bundle jar包中 对于这种可以使用另外一种方式通过 Export-Package 导出。 还是用 mysql-connector-java 驱动来尝试以本地Lib方式设置pom依赖scope设置为system、并指定本地Lib文件路径然后再设置 Export-Package 进行导出 Export-Packagecom.xxx.osgi.helloworld.client;version${project.version},com.mysql.cj;version8.0.32,com.mysql.jdbc;version8.0.32 /Export-Package jar tf helloworld-client-1.0.0-SNAPSHOT.jar 查看bundle jar包结构如下 5编译打包 mvn clean package 执行命令就会生成目标jar文件 生成的jar内容结构查看使用 jar tf jarFileName 命令查看 e:\ws2\qf\helloworld\helloworld-client\target jar tf helloworld-client-1.0.0-SNAPSHOT.jar 6添加 debug / run 配置可在idea中运行或调试 为client和server分别添加一个 debug/run 配置Bundle name配置中添加 4个 必须依赖的系统jar和各自子模块的jar 添加 debug/run 配置并运行后会自动生成  out 目录 7拷贝生成的 client server bundle(jar) 到OSGI环境执行 我本地Windows配置的OSGI运行环境位于d:\osgi\equinox\ d: cd d:\osgi\equinox\ d:\osgi\equinox ls  org.eclipse.osgi_3.18.600.v20231110-1900.jar plugins start.bat d:\osgi\equinox mkdir  my_bundles d:\osgi\equinox cp e:\ws2\qf\helloworld\helloworld-client\target\helloworld-client-1.0.0-SNAPSHOT.jar my_bundles\helloworld-client-1.0.0-SNAPSHOT.jar d:\osgi\equinox cp e:\ws2\qf\helloworld\helloworld-server\target\helloworld-server-1.0.0-SNAPSHOT.jar my_bundles\helloworld-server-1.0.0-SNAPSHOT.jar 8执行bundles install start bundlesserver需要先启动、再启动client 到此为止基于Maven构建OSGI应用示例完毕。 注意如果pom中指定maven.compiler.source8/maven.compiler.source时编译报错java: Compilation failed: internal java compiler error报错截图如下 检查下面几处相关设置是否正确 1检查File-Project Structure-Project Settings-Modules配置中的Dependencies-Module SDK 2检查Settings-Buile,Execution,Deployment-Compiler-Java Compiler设置Module的Per-module bytecode version-Target bytecode version 如果 Per-module bytecode version - Target bytecode version 不一致我最初默认是1.5、修改为一致8问题就解决了。
http://www.yutouwan.com/news/405441/

相关文章:

  • 做网站郑州汉狮推广方法的总结
  • 做设计.不抠图网站做同城信息网站怎么赚钱
  • 网站托管运营所需资料重庆建设工程质量监督检测中心
  • 网站的外链建设计划linux系统打开wordpress
  • wap网站建设流程购物app开发多少钱
  • 链家做网站和手机app花了多少钱西安网站开发建设
  • 快速制作网站泰安房产网签西湖春晓
  • 茂名做网站dyiee杭州猎头公司
  • 番禺南村网站建设哈尔滨模板自助建站
  • 江门专用网站建设seo网上培训多少钱
  • 微软的网站开发软件培训型网站 建设方案
  • 自由贸易区的建设网站湖南企业网络推广服务
  • 像那种代刷网站怎么做请人代做谷歌外贸网站
  • 我要建企业营销型网站一键自助建站
  • 怎么棋牌网站建设虚拟机建设网站
  • 照片做视频ppt模板下载网站网站已经收录了 但是输入公司名找不到
  • 在猪八戒做网站有保障吗百姓网免费发布信息网下载
  • 陕西建设网官方网站上海行业门户网站建设技术
  • 外贸网站模什么网站做海报赚钱
  • 网站建设中朝阳区北京网站建设
  • 网站红色搭配wordpress 插件
  • 杭州网站建设网站wordpress ftp设置方法
  • 专业北京网站建设公司排名十堰网站搜索优化价格
  • 怎么样才能找到网站后台网址附近招工 最新招聘信息
  • 有哪些做微场景的没费网站网站基础上添加建设方案模板
  • 餐饮网站欣赏中国那个公司的网站做的最好
  • 企业产品网站模板深圳网站设计建设公司
  • 论文 网站建设网页设计建立站点步骤
  • 个人性质的网站wordpress批量目录
  • 营销型网站开发推广wordpress搭建小程序