1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns =" http://maven.apache.org/POM/4.0.0"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <modelVersion >4.0.0</modelVersion >
6
+ <parent >
7
+ <groupId >io.zerows</groupId >
8
+ <artifactId >zero-entry</artifactId >
9
+ <version >1.0-SNAPSHOT</version >
10
+ </parent >
11
+
12
+ <artifactId >zero-entry-bootstrap-osgi</artifactId >
13
+ <name >Zero.Entry.BootStrap.OSGI</name >
14
+ <packaging >bundle</packaging >
15
+ <dependencies >
16
+ <dependency >
17
+ <groupId >io.zerows</groupId >
18
+ <artifactId >zero-core-runtime-metadata</artifactId >
19
+ </dependency >
20
+ </dependencies >
21
+ <build >
22
+ <plugins >
23
+ <plugin >
24
+ <groupId >org.apache.felix</groupId >
25
+ <artifactId >maven-bundle-plugin</artifactId >
26
+ <extensions >true</extensions >
27
+ <configuration >
28
+ <instructions >
29
+ <Export-Package >
30
+ <!-- SPI Required -->
31
+ io.zerows.core.metadata.osgi.spi.*;-split-package:=merge-first,
32
+
33
+ io.zerows.core.entry.module.*,
34
+ </Export-Package >
35
+ <Import-Package >
36
+ *;resolution:=optional,
37
+ </Import-Package >
38
+ <Embed-Transitive >true</Embed-Transitive >
39
+ <!--
40
+ 在 JDK 9 之后,OSGI的打包会引起部分警告信息:
41
+ [WARNING] Osgi io.zerows:zero-ams:bundle:1.0-SNAPSHOT :
42
+ Classes found in the wrong directory: {META-INF/versions/9/module-info.class=module-info.class}
43
+ 此错误信息在编译的时候不会有问题,但在IDEA识别时会阻拦IDEA的运行,如直接导致IDEA中无法启动应用,因此,
44
+ 需要在打包的时候忽略此错误信息,具体配置如下:
45
+ -->
46
+ <_fixupmessages >
47
+ "Classes found in the wrong directory";restrict:=error;is:=ignore
48
+ </_fixupmessages >
49
+ </instructions >
50
+ </configuration >
51
+ </plugin >
52
+ <plugin >
53
+ <artifactId >maven-compiler-plugin</artifactId >
54
+ <version >${maven.plugin.compiler} </version >
55
+ <configuration >
56
+ <source >${java.version} </source >
57
+ <target >${java.version} </target >
58
+ <!-- <compilerArgs>
59
+ <arg>-verbose</arg>
60
+ <arg>-Xlint:all,-options,-path</arg>
61
+ </compilerArgs>-->
62
+ </configuration >
63
+ </plugin >
64
+ <plugin >
65
+ <groupId >org.apache.maven.plugins</groupId >
66
+ <artifactId >maven-dependency-plugin</artifactId >
67
+ <executions >
68
+ <execution >
69
+ <id >copy-dependencies</id >
70
+ <phase >package</phase >
71
+ <goals >
72
+ <goal >copy-dependencies</goal >
73
+ </goals >
74
+ <configuration >
75
+ <!-- <includeScope>compile</includeScope> -->
76
+ <type >jar</type >
77
+ <includeTypes >jar</includeTypes >
78
+ <!-- 存放服务依赖的jar包,存放在服务相同目录的lib文件夹下 -->
79
+ <outputDirectory >
80
+ target/lib
81
+ </outputDirectory >
82
+ </configuration >
83
+ </execution >
84
+ </executions >
85
+ </plugin >
86
+ </plugins >
87
+ </build >
88
+ </project >
0 commit comments