[ERROR] Error while generating code.Location : com.sun.istack.SAXParseException2; systemId: jar:file:/C:/commons-0.0.1-SNAPSHOT.jar!/Commons.xsd; lineNumber: 15; columnNumber: 36; compiler was unable to honor annox:annotate schemaBinding customization. It is attached to a wrong place, or its inconsistent with other bindings.
第一模块
>
“commons.xsd”:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns="http://www.test.com/commons" targetNamespace="http://www.test.com/commons" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:annox="http://annox.dev.java.net" xmlns:swagger="http://annox.dev.java.net/com.wordnik.swagger.annotations" xmlns:xs="http://www.w3.org/2001/XMLSchema" jaxb:extensionBindingPrefixes="annox" jaxb:version="2.1">
<xs:complexType name="BaseType">
<xs:annotation>
<xs:appinfo>
<annox:annotate target="class">
<swagger:ApiModel value="BaseType" description="Description" />
</annox:annotate>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
<xs:element name="field1" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
“pom.xml”:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>commons</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<args>
<arg>-Xannotate</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.5</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.5</version>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.test.com/extension" targetNamespace="http://www.test.com/extension" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:annox="http://annox.dev.java.net" xmlns:swagger="http://annox.dev.java.net/com.wordnik.swagger.annotations" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.test.com/commons" elementFormDefault="unqualified" attributeFormDefault="unqualified" jaxb:extensionBindingPrefixes="annox" jaxb:version="2.1">
<xs:import namespace="http://www.test.com/commons" schemaLocation="Commons.xsd" />
<xs:complexType name="Extension">
<xs:annotation>
<xs:appinfo>
<annox:annotate target="class">
<swagger:ApiModel value="Extension" description="Description" />
</annox:annotate>
</xs:appinfo>
</xs:annotation>
<xs:complexContent>
<xs:extension base="c:BaseType">
<xs:sequence>
<xs:element name="field2" type="xs:integer" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>extension</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>test</groupId>
<artifactId>commons</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<args>
<arg>-Xannotate</arg>
</args>
<episodes>
<episode>
<groupId>test</groupId>
<artifactId>commons</artifactId>
</episode>
</episodes>
<catalog>src/main/resources/catalog.xml</catalog>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.5</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.5</version>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<systemSuffix systemIdSuffix="Commons.xsd" uri="maven:test:commons!/Commons.xsd" />
</catalog>
这几天我一直在努力解决这个错误,但没有成功。
使用annox和Episodes存在一个bug。
我已经通过外部绑定(xjb文件)解决了同样的问题。这样,模式也是干净的。
例如。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
jaxb:extensionBindingPrefixes="xjc annox"
version="2.1">
<jaxb:globalBindings>
<jaxb:serializable uid="12345"/>
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="domain1.xsd" node="/xs:schema">
<jaxb:bindings node="xs:complexType[@name='SomeRootType']">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="SomeRootType"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
<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/schema/xjb</bindingDirectory>
<bindingIncludes>
<include>*.xjb</include>
</bindingIncludes>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/resources/schema/project/b</directory>
<includes>
<include>*.xsd</include>
</includes>
</fileset>
</schema>
<schema>
<dependencyResource>
<groupId>com.project.a</groupId>
<artifactId>artifact.a</artifactId>
<resource>schema/a.xsd</resource>
</dependencyResource>
</schema>
</schemas>
<episodes>
<episode>
<groupId>com.project.a</groupId>
<artifactId>artifact.a</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>
我试图从子文件夹加载fxml,但失败了。我有做替换场景内容的行: 谢谢
我试着运行mvn声纳:声纳,我得到了这个: [ERROR]无法在YamarinArtifactId项目上执行goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar(默认-CLI):Can not execute sonar:FxCop执行失败。FxCop执行失败,返回代码为“521”。有关更多信息,请查看FxCop文档。->[帮助1] 你知道该怎么办
无法生成ionic cordova build android--prod配置项目时出现问题:app'。 未指定compileSdkVersion。请将其添加到构建中。格拉德尔 build.gradle(app) /*根据一个或多个投稿者许可协议授权给Apache软件基金会(ASF)。有关版权所有权的更多信息,请参阅随本作品一起分发的通知文件。ASF根据Apache许可证2.0版(以下简称“许可证
我正在为Rest控制器编写一个错误条件的测试用例,当我将expected exception设置为exception.class时,测试运行时没有错误。当我将预期的异常更改为CustomException.class时,测试失败并出现断言错误 下面是我的控制器类: 如上所述,如果我在测试中将预期的异常更改为CustomException.class,如下所示: 我看到导致测试失败。我尝试了@Rul
在我连接到Docker容器后,我无法从其上分离。 我尝试用附加,但不起作用 Java进程永不结束
问题内容: 在遵循几个.NET Core 2.0 Visual Studio Team Services连续集成/连续交付示例之后,我遇到了VSTS中的复制错误。 通过VS17添加docker支持可以在本地使用这样的dockerfile很好地工作。 借助MVC应用程序和WebAPI应用程序,它可以在本地与docker-compose完美结合。 添加VSTS CI构建过程并运行它时,我一直在副本中遇