Используя Maven-bundle-plugin, как я могу упаковать зависимые jar как .class (извлеченные jars) - PullRequest
0 голосов
/ 28 ноября 2018

Мне нужен maven-bundle-plugin для генерации jar с расширенными зависимыми jar.Моя конфигурация плагина в pom.xml выглядит так:

<plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>3.3.0</version>
            <extensions>true</extensions>
           <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                  </executions>
                <configuration>
                    <manifestLocation>${project.build.outputDirectory}/META-INF/</manifestLocation> <!-- make sure this is present! in the example of maven bundle plugin documentation, this piece is NOT present -->
                    <exportScr>true</exportScr> <!-- be sure to add this line as well -->
                    <supportedProjectTypes>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                        <supportedProjectType>war</supportedProjectType>
                    </supportedProjectTypes>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <_dsannotations>*</_dsannotations>
                        <!-- we explicitly import the interfaces package, not the implementations, otherwise we get into dependency and version hell -->
                        <Import-Package>com.ooo.dis.common.extensions.interfaces;version=${platformVersion},com.ooo.dis.analysis.common.interfaces;version=${platformVersion},javax.json,javax.ws.rs.client</Import-Package>
                        <Build-Timestamp> ${maven.build.timestamp}</Build-Timestamp>
                        <Include-Resource>{maven-resources},schemes=target/classes/schemes</Include-Resource><!-- override schemes with the one generated by the processor -->
                       <Embed-Dependency>*</Embed-Dependency>

                     </instructions>
                </configuration>
          </plugin>

maven-assembly-plugin работает для этого.но есть ли способ, которым это может быть достигнуто с помощью плагина Maven-bundle?

1 Ответ

0 голосов
/ 28 ноября 2018

Плагин комплекта имеет опцию конфигурации для встраивания (расширения) классов jar-зависимостей вместо встраивания самих jar-файлов:

    <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>

Это упоминается в нижней части раздела «Встраивание зависимостей» в плагин doc .

...