简体   繁体   English

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

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

I have a maven build which auto-generates a set JAXB java source files. 我有一个Maven构建,它会自动生成一组JAXB Java源文件。 The basic config is 基本配置是

<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>

If i run 'maven clean package' the source files are correctly generated but process goes onto to try and downloaded these jars. 如果我运行“ maven clean package”,则将正确生成源文件,但过程将继续尝试并下载这些jar。 I realise I can manually install the required jars from the instructions outlined on the Maven JAXB Plug-in page, but I'm wondering is there an alternative way to avoid the sun web service jar dependencies. 我意识到我可以按照Maven JAXB插件页面上概述的说明手动安装所需的jar,但是我想知道是否还有另一种方法可以避免对sun Web服务jar的依赖。 Should i use different versions for the JAXP or maven plugins?. 我应该为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

I don't understand where do you get these jwsdp:jaxb-libs dependencies from. 我不知道您从哪里获得这些jwsdp:jaxb-libs依赖关系。 How do you come to the idea that you need them? 您如何想到需要它们的想法? Maybe one of these sample projects may be helpful to get you started. 这些示例项目之一可能对您入门很有帮助。 Your projects noramlly have 您的项目通常具有

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

as dependency. 作为依赖。 If you're using JAXB2 Basics then you'll also need: 如果您使用的是JAXB2基础,那么您还需要:

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

You normally don't need jwsdp as dependency. 您通常不需要jwsdp作为依赖项。 But maybe I'm missing something. 但是也许我想念一些东西。

Next, this plugin: http://maven-plugins.sourceforge.net/maven-jaxb-plugin/ does not have anything to do with maven-jaxb2-plugin you are using. 接下来,这个插件: http : maven-jaxb2-plugin您使用的maven-jaxb2-plugin没有任何关系。

Finally, I recommend adding JAXB plugins as configuration/plugins , not as dependencies. 最后,我建议将JAXB插件添加为configuration/plugins而不是依赖项。 See this guide . 请参阅本指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM