经常有相关的Background scanning of projects
人抱怨这种情况在NetBeans
开始的时候会发生。
我有一个项目,Spring Boot 2.6.x
使用.Maven 3.8.2
Cisco AXL Schema 12.5
由此生成Apache CXF
了AXL Schema
大量的Java源代码文件。
当我Clean and Build
在我的项目之后立即Background scanning of projects
开始时。
而且最近大部分时间都需要很长时间。
例如,我看到它也扫描
netbeans-12.6/webcommon/jsstubs/corestubs.zip
为什么在构建我的项目时也要扫描它?
但大多数时候,虽然它显示 100% 扫描完成,但它花费在生成的 Java 源代码文件所在的文件夹中
<project folder>/target/generated/cxf
有 2282 个生成的 Java 源代码文件。
我不确定是否NetBeans
挂起或真正扫描这些文件,它显示 100% 扫描,所以应该完成。
通常它需要太长时间,所以我必须NetBeans
从控制台终止。重新启动后NetBeans
开始Background scanning for projects
并需要更短的时间,但这很烦人。
我能做些什么呢?
当我NetBeans
从控制台开始时,我只做./netbeans
. 如果从 开始有区别NetBeans
吗sudo ./netbeans
?
这是我的项目文件夹/文件结构的样子,也许我没有正确使用:
首先,我提取了我的文件夹AXL Schema
旁边的src
<project folder>
-> schema
-> 12.5
AXLAPI.wsdl
AXLEnums.xsd
AXLSoap.xsd
-> src
-> main/...
-> test/...
在pom.xml
我使用
...
<build>
...
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.4.5</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/schema/12.5/AXLAPI.wsdl</wsdl>
<wsdlLocation>classpath:schema/12.5/AXLAPI.wsdl</wsdlLocation>
<extraargs></extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
...
<resources>
...
<resource>
<directory>./</directory>
<includes>
<include>schema/**</include>
</includes>
</resource>
<resource>
<directory>target/generated/cxf</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
...
</resources>
</build>
...
也许这个pom.xml
设置不正确,这就是Background scanning for projects
工作错误的原因。
war
当我在构建后查看生成的文件时,我看到
WEB-INF
-> classes
-> com/cisco/axl/api/_12
-> schema/12.5
并且有些文物可能不属于那里。
例如,com/cisco/axl/api/_12
不仅有class
文件,还有所有相关的生成Java
源代码文件(全部 2282)。
也许schema/12.5
也不应该在war
文件中。