2017-09-22 95 views
0

我有一个Spring-boot项目,我需要从WSDL位置获得generated sources避免在目标/生成源的循环中构建项目

我对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

那么,有没有办法避免建设项目,而不从构建路径中删除生成的来源是什么?

回答

1

项目>属性:建造你可以(临时)禁止其他项目的建设者超过的Java构建通过取消他们(其中编译Java代码)。

+0

这是有效的。是否有任何已知的副作用? – Patrick

+0

这取决于停用的建造者, G。 _Maven Project Builder_将在编辑'pom.xml'文件时更新Java构建路径。如果出现不必要的副作用,请暂时激活所有构建者并清理所有项目以获得完整构建。 – howlger

+0

我解除了Maven项目生成器。可以手动构建pom.xml中的更改。如果这对我来说不是问题。 – Patrick