项目构建错误:未知包装:捆绑

dis*_*ame 14 xml eclipse maven pdfbox

我正在尝试构建pdfbox但我似乎无法解决此Maven错误:

Project build error: Unknown packaging: bundle

其中只出现在子项目pdfboxpreflight.

我已经安装了m2e连接器并构建了帮助程序,正如我在这里建议的那样,我安装了Tycho,但它也没有帮助.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-parent</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <relativePath>../parent/pom.xml</relativePath>
    </parent>

    <artifactId>pdfbox</artifactId>
    <packaging>bundle</packaging> <!-- Project build error: Unknown packaging: bundle -->

    <!-- ... -->

    <dependencies>
        <!-- ... -->
    </dependencies>

    <build>
       <!-- ... -->
    <pluginManagement>
    <plugins>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <argLine>-Xmx128m</argLine>
                <excludes>
                    <exclude>org/apache/pdfbox/TestAll.java</exclude>
                    <exclude>org/apache/pdfbox/util/TestPDFToImage.java</exclude>
                </excludes>
                <systemPropertyVariables>
                    <java.util.logging.config.file>src/test/resources/logging.properties</java.util.logging.config.file>
                </systemPropertyVariables>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Include-Resource>
                        {maven-resources},
                        META-INF=target/maven-shared-archive-resources/META-INF,
                        org/apache/pdfbox/resources=target/classes/org/apache/pdfbox/resources
                    </Include-Resource>
                </instructions>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.rat</groupId>
            <artifactId>apache-rat-plugin</artifactId>
            <configuration>
                <excludes>
                    <exclude>src/main/resources/org/apache/pdfbox/resources/afm/*</exclude>
                    <exclude>src/main/resources/org/apache/pdfbox/resources/icc/*</exclude>
                    <exclude>src/main/resources/org/apache/pdfbox/resources/glyphlist/glyphlist.txt</exclude>
                    <exclude>src/main/resources/org/apache/pdfbox/resources/glyphlist/zapfdingbats.txt</exclude>
                    <exclude>src/main/resources/META-INF/services/*</exclude>
                    <exclude>src/test/resources/input/rendering/*.ai</exclude>
                    <exclude>src/test/resources/output/*</exclude>
                    <exclude>release.properties</exclude>
                    <exclude>src/test/resources/org/apache/pdfbox/encryption/*.der</exclude>
                    <exclude>src/test/resources/org/apache/pdfbox/encryption/*.pfx</exclude>
                    <exclude>src/test/resources/org/apache/pdfbox/filter/*.bin</exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
    </pluginManagement>
    </build>

</project>
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题?

poo*_*hla 26

在我的情况下,它已经超出了插件管理标签.它通过添加解决了我

<extensions>true</extensions>

到插件标签


Rob*_*lte 20

搬到maven-bundle-plugin外面pluginManagement.Maven只会查找<build><plugins>和使用pluginManagement其他信息.

  • 删除了我的最后一条评论:这有效!导致另一个 Maven 问题,但解决了捆绑错误。 (2认同)
  • 感谢您的解决方案,解决了我的 mule 未知包错误 (2认同)

小智 6

尝试一下你的 pom.xml,它适用于我的:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions> <!--add this line-->
            <configuration>
                <instructions>
                    <Export-Package>com.demo.hello.*</Export-Package>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)