error running process-resources phase when updating folders in Maven Projects tab

Hi I am getting the error

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building CSA Website Tester
[INFO]
[INFO] Id: com.csatp.monitor:Reaper:jar:0.9
[INFO] task-segment: [process-resources]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[ERROR] BUILD FAILED
[ERROR] Error copying resources

d:\Temp\maven\Reaper\target\classes\C:\devel\intellij\server_admin\reaper\d:\Temp\maven\Reaper\target\restartappserver.bat (The filename, directory name, or volume label syntax is incorrect)

To view full stack traces, please go to the Settings->Maven and check the 'Print Exception Stack Traces' box.


when running the process-resources phase after clicking the "Update Folders" or "Re-import Maven Projects" buttons in the "Maven Projects" tab in IntelliJ.

My environment is Maven 2.2.1 and IntelliJ 8.1.3, JDK 1.6.0_16, Windows Vista.

This is a snippet of my pom file containing the section that is causing this.

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/command</directory>
                <includes>
                    <include>restartappserver.bat</include>
                    <include>restartappserver.sh</include>
                </includes>
                <targetPath>${project.build.directory}</targetPath>
            </resource>
            <resource>
                <directory>${basedir}/src/main/filters</directory>
                <includes>
                    <include>reaper.properties</include>
                </includes>
                <targetPath>${project.build.directory}</targetPath>
            </resource>
        </resources>


If I remove the targetPath element, reparsing the pom works just fine.  Also running maven:package from the command line or from IntelliJ also builds an output directory as I expect.  I tried searching for this and have found nothing.  The reimport of the pom in IJ seems to be building an output path with three locations.

d:\Temp\maven\Reaper\target\classes\C:\devel\intellij\server_admin\reaper\d:\Temp\maven\Reaper\target\restartappserver.bat


Any ideas what I've done wrong or if its a bug?

Marc

0
2 comments

Hi, Marc,.

The problem is that IDEA 8.x is bundled with Maven Embedder that is not always compatible with your command line Maven instllation. Please try 9.0 eap - we've bundled Maven 2.2 and the problem should have been fixed.

http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP

Thanks,
Anton Makeev

0
Avatar
Permanently deleted user

Thanks Anton,

I upgraded to 90.154 and it changed my setup.  Now I get the same error but with a shorter build directory.

Old
d:\Temp\maven\Reaper\target\classes\C:\devel\intellij\server_admin\reaper\d:\Temp\maven\Reaper\target\restartappserver.bat
New
d:\Temp\maven\Reaper\target\classes\d:\Temp\maven\Reaper\target\restartappserver.bat

It seems as if placing project.build.directory in the targetPath element uses both.

<targetPath>${project.build.directory}</targetPath>


I found a workaround by not using a maven variable but rather assuming the target was target/classes and specifying this to go up one level to target then down into the structure I needed.

<targetPath>../output/scripts</targetPath>

This is allowing me to build an output directory for my needs.


IJ 9 is going in a good direction BTW.  Thanks.

Marc

0

Please sign in to leave a comment.