gpt4 book ai didi

java - 避免在目标/生成源的循环中构建项目

转载 作者:行者123 更新时间:2023-12-01 20:13:12 24 4
gpt4 key购买 nike

我有一个 Spring-boot 项目,我需要从 WSDL 位置生成源

我的 WSDL 端点的 Maven 构建插件如下所示:

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::wsdl[] -->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.13.2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<args>
<arg>-XautoNameResolution</arg>
</args>
<locale>DE</locale>
<schemaLanguage>WSDL</schemaLanguage>
<generatePackage>com.myCompany.myProject.wsdl.svs</generatePackage>
<schemas>
<schema>
<url>https://urlToWS.wsdl</url>
</schema>
</schemas>
</configuration>
</plugin>
<!-- end::wsdl[] -->
</plugins>
</build>

源的生成按预期工作,并且位于我的项目的 target/generated-sources/xjc 下:

enter image description here

我的问题是,eclipse(或maven)每秒都会构建这个项目。这真的很烦人,因为所有其他任务都必须等待构建。

我知道我可以从构建路径中删除此文件夹。但如果我这样做,我也会删除我的源代码,并且我的项目处于无效状态。

enter image description here

那么有没有办法在不从构建路径中删除生成的源的情况下避免构建项目?

最佳答案

项目>属性:构建器中,您可以(临时)禁用除Java Builder之外的其他项目构建器(通过取消选中它们来编译 Java 代码)。

关于java - 避免在目标/生成源的循环中构建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46360537/

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