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 - Netbean failed to copy file while compiling project war file
Summary: Netbean failed to copy file while compiling project war file
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: issues@ide
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 06:22 UTC by shmu80
Modified: 2017-07-07 06:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbean Maven war file build sequence (369.49 KB, application/octet-stream)
2017-07-07 06:22 UTC, shmu80
Details

Note You need to log in before you can comment on or make changes to this bug.
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