[英]Does Enunicate maven plug-in could generate the data model which in other java project?
您能帮我解决使用Enunciate Maven插件遇到的问题吗? 问题是我的域在其他项目中,而不是在API项目中(不是程序包,而是在Java项目中),因此在生成文档时,没有数据模型,但是我在以下项目的同一项目中创建了数据模型(@XmlRootElement) API,它生成了。 那么,插件可以生成其他项目中的数据模型吗?
1.从您的外部API项目中导出源代码如果此API项目是模块,则可以将其添加到API项目或父项目中
<project ...>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2.在您的enunciate.xml文件中添加对该包的引用
<enunciate ...>
<api-import pattern="com.mycompany.pck1.dao.*" />
</enunciate ...>
3. 创建对外部项目源的依赖关系 。
<project ...>
...
<dependencies>
...
<dependency>
<groupId>...</groupId>
<artifactId>domain</artifactId>
<version>...</version>
<classifier>sources</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
...
</dependencies>
**会尝试编译您的代码,因此您需要将所有依赖项添加到外部库中
更多帮助: 多模块项目
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.