Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jsonschema2pojo未创建生成的java对象_Java_Json_Maven_Hl7 Fhir_Jsonschema2pojo - Fatal编程技术网

jsonschema2pojo未创建生成的java对象

jsonschema2pojo未创建生成的java对象,java,json,maven,hl7-fhir,jsonschema2pojo,Java,Json,Maven,Hl7 Fhir,Jsonschema2pojo,我试图使用jsonschema2pojo将FHIR模式转换为java对象。如果我使用它,那么生成的java类就可以创建了,但是当我使用它时,就不会创建任何东西,我也看不到任何错误来理解为什么没有创建它。有人能帮我理解失败在哪里吗 我的pom文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"

我试图使用jsonschema2pojo将FHIR模式转换为java对象。如果我使用它,那么生成的java类就可以创建了,但是当我使用它时,就不会创建任何东西,我也看不到任何错误来理解为什么没有创建它。有人能帮我理解失败在哪里吗

我的pom文件

<?xml version="1.0" encoding="UTF-8"?>
<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>org.example</groupId>
<artifactId>DMSAdpater</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.jsonschema2pojo</groupId>
            <artifactId>jsonschema2pojo-maven-plugin</artifactId>
            <version>1.0.2</version>
            <configuration>
                <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
                <targetPackage>com.example.types</targetPackage>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.5.4</version>
    </dependency>
</dependencies>

4.0.0
org.example
二甲基亚砜
1.0-快照
org.apache.maven.plugins
maven编译器插件
1.6
1.6
org.jsonschema2pojo
jsonschema2pojo maven插件
1.0.2
${basedir}/src/main/resources/schema
com.example.types
生成
公地郎
公地郎
2.4
com.fasterxml.jackson.core
杰克逊数据绑定
2.5.4
我的mvn编译的输出

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:DMSAdpater:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 13, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------------< org.example:DMSAdpater >-----------------------
[INFO] Building DMSAdpater 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ DMSAdpater ---
[INFO] Deleting H:\Workspaces\HDI\Project\DMS_Adapter\target
[INFO]
[INFO] --- jsonschema2pojo-maven-plugin:1.0.2:generate (default) @ DMSAdpater ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ DMSAdpater ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ DMSAdpater ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  25.745 s
[INFO] Finished at: 2020-07-13T12:01:07-04:00
[INFO] ------------------------------------------------------------------------
[INFO]正在扫描项目。。。
[警告]
[警告]为组织构建有效模型时遇到一些问题。示例:dmsadater:jar:1.0-SNAPSHOT
[警告]“org.apache.maven.plugins:maven编译器插件”的“build.plugins.plugin.version”丢失。@第13行第21列
[警告]
[警告]强烈建议修复这些问题,因为它们会威胁到构建的稳定性。
[警告]
[警告]出于这个原因,未来的Maven版本可能不再支持构建这种格式错误的项目。
[警告]
[信息]
[信息]-------------------------------------------------
[信息]正在构建DMSADater 1.0-SNAPSHOT
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven clean插件:2.5:clean(默认清洁)@dmsaDater---
[信息]删除H:\Workspaces\HDI\Project\DMS\u Adapter\target
[信息]
[信息]--jsonschema2pojo maven插件:1.0.2:generate(默认)@DMSAdpater---
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@DMSAdpater---
[警告]使用平台编码(实际上是Cp1252)复制过滤后的资源,即构建依赖于平台!
[信息]正在复制11个资源
[信息]
[信息]---maven编译器插件:3.1:compile(默认编译)@DMSAdpater---
[信息]无需编译-所有类都是最新的
[信息]------------------------------------------------------------------------
[信息]建立成功
[信息]------------------------------------------------------------------------
[信息]总时间:25.745秒
[信息]完成时间:2020-07-13T12:01:07-04:00
[信息]------------------------------------------------------------------------

一般来说,我不会尝试从模式中为FHIR生成Java代码。您最好使用HAPI开源Java参考实现。(模式不表达与FHIR相关的许多规则,您生成的代码也不会像专门为支持FHIR而设计的API那样干净/有能力。)FHIR的JSON模式非常复杂,因为resourceType属性。这很可能是问题的根源——根据一般规则,所有定义都是依赖的,因此我不会尝试从模式生成FHIR的Java代码。您最好使用HAPI开源Java参考实现。(模式不表达与FHIR相关的许多规则,您生成的代码也不会像专门为支持FHIR而设计的API那样干净/有能力。)FHIR的JSON模式非常复杂,因为resourceType属性。这可能是问题的根源——与所有定义的依赖方式有关