This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271054

Summary: Netbean failed to copy file while compiling project war file
Product: ide Reporter: shmu80
Component: CodeAssignee: issues@ide <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: Netbean Maven war file build sequence

Description shmu80 2017-07-07 06:22:13 UTC
Created attachment 164713 [details]
Netbean Maven war file build sequence

I am using Netbean 8.2 to perform Maven run to generate project war file, and the compilation is base on different Maven profile to relocated specific file to target location.

Maven pom.xml example
....
<profile>
        <id>server</id>
        <activation>
            <activeByDefault>false</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                    <executions>
                        <execution>
                            <id>copy-resources</id>
                            <!-- here the phase you need -->
                            <phase>package</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
                                <resources>
                                    <resource>
                                        <directory>${project.basedir}/src/main/config/qa</directory>
                                        <filtering>true</filtering>
                                        <includes>
                                            <include>*.properties</include>
                                            <include>*.xml</include>
                                        </includes>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
.....

Anyway, after the Maven run (clean install , profile=server) complete, I found the specific files is not exists inside the project war file, but it only exists in target\project\WEB-INF\classes folder.

These situation happen because Netbean will generate the project war file before it move the specific file to target location.

Please refer to the netbean.log for the project war file generate sequence