久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

jaxb、xsd 導(dǎo)入無法識(shí)別

jaxb, xsd import not recognized(jaxb、xsd 導(dǎo)入無法識(shí)別)
本文介紹了jaxb、xsd 導(dǎo)入無法識(shí)別的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我對(duì) jaxb 插件有一個(gè)大問題.我有一個(gè)項(xiàng)目 A,其中有 src/main/resources/xsd/common.xsd 文件.在這個(gè)項(xiàng)目中,我使用 cxf-xjc-plugin生成java類.我在 src/main/resources/META-INF 下也有我的情節(jié)文件,名為 sun-jaxb.episode

I have a big problem with jaxb plugin. I have a project A where I have src/main/resources/xsd/common.xsd file. In this project I use cxf-xjc-plugin to generate java classes. I have also my episod file under src/main/resources/META-INF called sun-jaxb.episode

接下來,我有項(xiàng)目 B,它對(duì)項(xiàng)目 A 具有 maven 依賴項(xiàng).在這個(gè)項(xiàng)目中,我有 src/main/resources/catalog.txt

Next, I have project B which has maven dependency to project A. In this project I have src/main/resources/catalog.txt

PUBLIC "http://www.some_path" "maven:GROUP_ID_OF_PROJECT_A:ARTIFACT_ID_OF_PROJECT_A:jar::!/common.xsd"

在項(xiàng)目 B 中,我有帶有 jaxb 插件的 pom 文件

In project B I have pom file with jaxb plugin

<plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <configuration>
                <extension>true</extension>
                <episodes>
                    <episode>
                        <groupId>GROUP_ID_OF_PROJECT_A</groupId>
                        <artifactId>ARTIFACT_ID_OF_PROJECT_A</artifactId>
                    </episode>
                </episodes>
                <catalogs>
                    <catalog>src/main/resources/catalog.txt</catalog>
                </catalogs>
            </configuration>
 </plugin>

接下來,我在項(xiàng)目B中

 src/main/resources/other/xsd my main.xsd 

我使用來自 common.xsd 的類型定義的文件

file where I use type definitions from common.xsd

我有 xmlns:cmns="http://www.some_path"http://和 catalog.txt 中的一樣和

I have xmlns:cmns="http://www.some_path" // it is the same as in catalog.txt and

<xs:import namespace="http://www.some_path"/> 

但問題是我收到錯(cuò)誤 undefined simple or complex type ,因?yàn)樗鼰o法識(shí)別 cmns

but the problem is that I get error undefined simple or complex type , because it doesn't recognize cmns

推薦答案

我用這個(gè)插件解決xsd的public import

I use this plugin to solve the public import of the xsd

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.8.1</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <args>
            <arg>-Xannotate</arg>
            <arg>-Xnamespace-prefix</arg>
            <arg>-nv</arg>
        </args>
        <extension>true</extension>
        <forceRegenerate>true</forceRegenerate>
        <bindingDirectory>${basedir}/src/main/resources/xjb</bindingDirectory>
        <bindingIncludes>
            <include>*.xjb</include>
        </bindingIncludes>
        <schemas>
            <schema>
                <fileset>
                    <directory>${basedir}/src/main/resources/xsd</directory>
                    <includes>
                        <include>*.xsd</include>
                    </includes>
                </fileset>
            </schema>
            <schema>
                <dependencyResource>
                    <groupId>groupID</groupId>
                    <artifactId>artifactID</artifactId>
                    <resource>target.xsd</resource>
                </dependencyResource>
            </schema>

        </schemas>
        <episodes>
            <episode>
                <groupId>groupID</groupId>
                <artifactId>artifactID</artifactId>
            </episode>
        </episodes>
        <debug>true</debug>
        <verbose>true</verbose>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb2_commons</groupId>
                <artifactId>jaxb2-basics</artifactId>
                <version>0.6.2</version>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2_commons</groupId>
                <artifactId>jaxb2-basics-annotate</artifactId>
                <version>0.6.2</version>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2_commons</groupId>
                <artifactId>jaxb2-namespace-prefix</artifactId>
                <version>1.1</version>
            </plugin>
        </plugins>
    </configuration>
</plugin>

<小時(shí)>

項(xiàng)目A的pom.xml插件

<plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.8.1</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <args>
                <arg>-Xannotate</arg>
                <arg>-nv</arg>
                <arg>-Xnamespace-prefix</arg>
            </args>
            <extension>true</extension>
            <schemas>
                <schema>
                    <fileset>
                        <directory>${basedir}/src/main/resources/xsd/</directory>
                        <includes>
                            <include>A.xsd</include>
                        </includes>
                    </fileset>
                </schema>
            </schemas>
            <bindingDirectory>src/main/resources/xjb</bindingDirectory>
            <bindingIncludes>
                <include>*.xjb</include>
            </bindingIncludes>
            <debug>true</debug>
            <verbose>true</verbose>
            <forceRegenerate>true</forceRegenerate>
            <plugins>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics</artifactId>
                    <version>0.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics-annotate</artifactId>
                    <version>0.6.0</version>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-namespace-prefix</artifactId>
                    <version>1.1</version>
                </plugin>
            </plugins>
        </configuration>
    </plugin>

項(xiàng)目B的pom.xml插件

<plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.8.1</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <args>
                <arg>-Xannotate</arg>
                <arg>-Xnamespace-prefix</arg>
                <arg>-nv</arg>
            </args>
            <extension>true</extension>
            <forceRegenerate>true</forceRegenerate>
            <bindingDirectory>${basedir}/src/main/resources/xjb</bindingDirectory>
            <bindingIncludes>
                <include>*.xjb</include>
            </bindingIncludes>
            <schemas>
                <schema>
                    <fileset>
                        <directory>${basedir}/src/main/resources/xsd/</directory>
                        <includes>
                            <include>B.xsd</include>
                        </includes>
                    </fileset>
                </schema>
                <schema>
                    <dependencyResource>
                        <groupId>AgroupID</groupId>
                        <artifactId>AartifactID</artifactId>
                        <resource>xsd/A.xsd</resource>
                    </dependencyResource>
                </schema>
            </schemas>
            <episodes>
                <episode>
                    <groupId>AgroupID</groupId>
                    <artifactId>AartifactID</artifactId>
                </episode>
            </episodes>
            <debug>true</debug>
            <verbose>true</verbose>
            <plugins>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics</artifactId>
                    <version>0.6.2</version>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics-annotate</artifactId>
                    <version>0.6.2</version>
                </plugin>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-namespace-prefix</artifactId>
                    <version>1.1</version>
                </plugin>
            </plugins>
        </configuration>
    </plugin>

您必須在項(xiàng)目 B 之前執(zhí)行項(xiàng)目 A 的 mvn 安裝

You must perform a mvn install of project A before the project B

添加此插件以添加到源目標(biāo)生成的類

Add this plugin to add to source target generated classes

          <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated-sources/xjc</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

記得執(zhí)行 Maven - 更新項(xiàng)目

Remember to perform Maven - update project

這篇關(guān)于jaxb、xsd 導(dǎo)入無法識(shí)別的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動(dòng)生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對(duì)象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 日韩在线不卡 | 欧美激情国产日韩精品一区18 | 亚洲综合中文字幕在线观看 | 一级片在线免费播放 | 国产免费一区二区三区最新6 | a级在线免费观看 | 久久成人免费 | 国产午夜精品一区二区三区四区 | 成人在线免费观看视频 | 成年人黄色一级片 | 精品欧美黑人一区二区三区 | 免费在线成人 | 黄色免费在线网址 | 永久免费视频 | 99久久精品国产毛片 | 国产精品a一区二区三区网址 | 自拍偷拍av | 中文精品视频 | 精品三区 | 国产精品久久久久久高潮 | 一区视频| 天天艹日日干 | www国产亚洲精品久久网站 | 成人在线观看免费爱爱 | 91福利在线观看视频 | 天堂素人约啪 | 九九色综合| 久久久一区二区三区 | 天天综合网91 | 久久久久久成人网 | 日韩精品久久一区二区三区 | 成人区精品一区二区婷婷 | 午夜播放器在线观看 | 久久久久国产一级毛片高清网站 | 日韩在线综合网 | 欧美一区二区三区电影 | 综合久久久 | 国产一二三区精品视频 | 亚洲精品自在在线观看 | 日韩在线观看视频一区 | 国产精品毛片一区二区三区 |