gpt4 book ai didi

Maven jaxb2 :xjc failing to generate code

转载 作者:IT老高 更新时间:2023-10-28 11:19:56 41 4
gpt4 key购买 nike

我在 pom.xml 中的 Maven 构建中添加了以下插件

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<extension>true</extension>
<clearOutputDir>false</clearOutputDir>
<schemaDirectory>${basedir}/src/main/resources/xsd</schemaDirectory>
<schemaFiles>myapp.xsd</schemaFiles>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<bindingDirectory>src/main/resources/xsd</bindingDirectory>
<bindingFiles>myapp-bindings.xjb</bindingFiles>
</configuration>
</execution>
</executions>

</plugin>

以下是构建错误。

[INFO] Ignored given or default xjbSources [C:\WorkSpace\MyApp\src\main\xjb], since it is not an existent file or directory.
[INFO] Ignored given or default sources [C:\WorkSpace\MyApp\src\main\xsd], since it is not an existent file or directory.
[WARNING] No XSD files found. Please check your plugin configuration.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.273s
[INFO] Finished at: Tue May 12 16:24:26 EDT 2015
[INFO] Final Memory: 9M/124M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dev-artifactory" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.1:xjc (default) on project pml-jasypt-authentication-service: MojoExecutionException: NoSchemasException -> [Help 1]

我一头雾水,为什么插件没有引用配置中指定的路径和文件。

最佳答案

2.1 版更改了指定来源的方式

http://mojo.codehaus.org/jaxb2-maven-plugin/xjc-mojo.html#sources

例如

<configuration>
...
<sources>
<source>some/explicit/relative/file.xsd</source>
<source>/another/absolute/path/to/a/specification.xsd</source>
<source>a/directory/holding/xsds</source>
</sources>
</configuration>

我遇到了一大堆其他问题,所以按照 jshark 的建议坚持使用 1.6 是一个不错的计划

关于Maven jaxb2 :xjc failing to generate code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30200807/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com