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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27994265/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 12:06:19  来源:igfitidea点击:

Project build error: Unknown packaging: bundle

xmleclipsemavenpdfbox

提问by displayname

I am trying to build pdfboxbut I can't seem to resolve this Maven error:

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

Project build error: Unknown packaging: bundle

Project build error: Unknown packaging: bundle

Which appear only in the sub-projects pdfboxand preflight.

哪些只出现在子项目pdfboxpreflight.

I have installed the m2e connector and build helper and as suggested hereI've installed Tycho but it didn't help either.

我已经安装了 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>

Does anybody know how to solve this issue?

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

回答by pooshla

in my case it was already outside of a plugin-management tag. it was solved for me by adding

就我而言,它已经在插件管理标签之外。通过添加它为我解决了

<extensions>true</extensions>

<extensions>true</extensions>

to the plugin tag

到插件标签

回答by Robert Scholte

Move maven-bundle-pluginoutside of pluginManagement. Maven will only look for <build><plugins>and uses pluginManagementfor additional information.

移动maven-bundle-plugin之外pluginManagement。Maven 只会寻找<build><plugins>和使用pluginManagement附加信息。

回答by Sniper Law

try this for your pom.xml, it works for mine:

为你的 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>

回答by Wolfgang Fahl

In case of

的情况下

https://github.com/rc-dukes/dukes/issues/22

https://github.com/rc-dukes/dukes/issues/22

there is a very strange behavior. We thought we could fix the issue by modifying the permissions. But infact it seems to be connected with some strange travis behavior where only every second or third build succeeds - even if no relevant content has been changed. We don't have a solution yet but would mention the work-around here to just retry a few times. Any hint on what the real fix is would be welcome.

有一种非常奇怪的行为。我们认为我们可以通过修改权限来解决这个问题。但事实上,它似乎与一些奇怪的 travis 行为有关,其中只有每第二或第三次构建成功 - 即使没有更改相关内容。我们还没有解决方案,但会在这里提到解决方法,只需重试几次。欢迎任何有关真正修复的提示。