簡體   English   中英

Maven jaxb2插件-我可以避免jwsdp依賴性

[英]maven jaxb2 plugin - can I avoid jwsdp dependencies

我有一個Maven構建,它會自動生成一組JAXB Java源文件。 基本配置是

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.7.5</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <includeSchemas>
            <includeSchema>*.xsd</includeSchema>
        </includeSchemas>
        <excludeSchemas>
            <excludeSchema>test*.xsd</excludeSchema>
        </excludeSchemas>
        <includeBindings>
            <includeBinding>*.xjb</includeBinding>
        </includeBindings>
        <strict>false</strict>
        <verbose>true</verbose>
        <debug>true</debug>
        <extension>true</extension>
        <!-- http://stackoverflow.com/questions/1999163/how-to-use-jaxb-commons-plugins-from-maven -->
        <args>
            <arg>-Xinheritance</arg>
        </args>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics</artifactId>
            <version>0.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-runtime</artifactId>
            <version>0.6.1</version>
        </dependency>
    </dependencies>
</plugin>

如果我運行“ maven clean package”,則將正確生成源文件,但過程將繼續嘗試並下載這些jar。 我意識到我可以按照Maven JAXB插件頁面上概述的說明手動安裝所需的jar,但是我想知道是否還有另一種方法可以避免對sun Web服務jar的依賴。 我應該為JAXP或Maven插件使用不同的版本嗎?

Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-api/jwsdp.1.5/jaxb-api-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-api:pom:jwsdp.1.5' in repository central (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-api/jwsdp.1.5/jaxb-api-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-api:pom:jwsdp.1.5' in repository java.net (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-api/jwsdp.1.5/jaxb-api-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-api:pom:jwsdp.1.5' in repository java.net2 (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-impl/jwsdp.1.5/jaxb-impl-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-impl:pom:jwsdp.1.5' in repository central (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-impl/jwsdp.1.5/jaxb-impl-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-impl:pom:jwsdp.1.5' in repository java.net (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-impl/jwsdp.1.5/jaxb-impl-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-impl:pom:jwsdp.1.5' in repository java.net2 (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-xjc/jwsdp.1.5/jaxb-xjc-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-xjc:pom:jwsdp.1.5' in repository central (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-xjc/jwsdp.1.5/jaxb-xjc-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-xjc:pom:jwsdp.1.5' in repository java.net (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-xjc/jwsdp.1.5/jaxb-xjc-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-xjc:pom:jwsdp.1.5' in repository java.net2 (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-libs/jwsdp.1.5/jaxb-libs-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-libs:pom:jwsdp.1.5' in repository central (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-libs/jwsdp.1.5/jaxb-libs-jwsdp.1.5.pom
[INFO] Unable to find resource 'jwsdp:jaxb-libs:pom:jwsdp.1.5' in repository java.net (http://host/archiva/repository/internal)
Downloading: http://host/archiva/repository/internal/jwsdp/jaxb-libs/jwsdp.1.5/jaxb-libs-jwsdp.1.5.pom

我不知道您從哪里獲得這些jwsdp:jaxb-libs依賴關系。 您如何想到需要它們的想法? 這些示例項目之一可能對您入門很有幫助。 您的項目通常具有

    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>${jaxb.version}</version>
    </dependency>

作為依賴。 如果您使用的是JAXB2基礎,那么您還需要:

    <dependency>
        <groupId>org.jvnet.jaxb2_commons</groupId>
        <artifactId>jaxb2-basics-runtime</artifactId>
        <version>${project.version}</version>
    </dependency>

您通常不需要jwsdp作為依賴項。 但是也許我想念一些東西。

接下來,這個插件: http : maven-jaxb2-plugin您使用的maven-jaxb2-plugin沒有任何關系。

最后,我建議將JAXB插件添加為configuration/plugins而不是依賴項。 請參閱本指南

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM