Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution fails if path to maven repository contains spaces on non-Windows systems #27

Closed
iheinrich opened this issue Sep 2, 2015 · 1 comment · Fixed by #28
Closed

Comments

@iheinrich
Copy link

Launch4j maven plugin fails to set the execute permissions if the "workdir" contains spaces. This only affects non-Windows systems.

How to reproduce:
On a non-Windows system execute mvn -Dmaven.repo.local="maven repo with spaces" package
Using this pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>sample</groupId>
    <artifactId>sample</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>com.akathist.maven.plugins.launch4j</groupId>
                <artifactId>launch4j-maven-plugin</artifactId>
                <version>1.7.7</version>
                <executions>
                    <execution>
                        <id>launch4j-console-exec</id>
                        <phase>package</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>console</headerType>
                            <classPath>
                                <mainClass>sample.MainClass</mainClass>
                            </classPath>
                            <jre>
                                <minVersion>1.7.0</minVersion>
                            </jre>
                            <versionInfo>
                                <fileVersion>1.0.0.0</fileVersion>
                                <txtFileVersion>${project.version}</txtFileVersion>
                                <fileDescription>${project.name}</fileDescription>
                                <productVersion>1.0.0.0</productVersion>
                                <txtProductVersion>${project.version}</txtProductVersion>
                                <copyright>copyleft</copyright>
                                <productName>${project.name}</productName>
                                <internalName>${project.artifactId}</internalName>
                                <originalFilename>sample.exe</originalFilename>
                            </versionInfo>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Build fails and console output contains an exception:

[ERROR] 
net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/iheinrich/sample/maven repo/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=13, Permission denied
    at net.sf.launch4j.Builder.build(Builder.java:146)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:336)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/iheinrich/sample/maven repo/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=13, Permission denied
    at net.sf.launch4j.Util.exec(Util.java:160)
    at net.sf.launch4j.Cmd.exec(Builder.java:212)
    at net.sf.launch4j.Builder.build(Builder.java:96)
    ... 22 more
Caused by: java.io.IOException: Cannot run program "/home/iheinrich/sample/maven repo/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at java.lang.Runtime.exec(Runtime.java:617)
    at java.lang.Runtime.exec(Runtime.java:485)
    at net.sf.launch4j.Util.exec(Util.java:128)
    ... 24 more
Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 27 more
@lukaszlenart
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants