0

I am currently trying to deploy a javafx native bundle. While this basically works fine it won´t deploy to any location given to <nativeOutputDir> by a contructed property using build-helper-maven-plugin and its regex-property goal.

Here´s my pom:

<build>
<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
            <execution>
                <id>regex-property</id>
                <goals>
                    <goal>regex-property</goal>
                </goals>
                <configuration>
                            <name>replaced.deploydir</name>
                            <value>${project.version}</value>
                            <regex>.+SNAPSHOT</regex>
                            <replacement>C:\\\\temp\\\\snapDir</replacement>
                            <failIfNoMatch>true</failIfNoMatch>
                            <failOnError>true</failOnError>
                </configuration>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <configuration>
            <mainClass>foo.bar.StartApp</mainClass>
            <nativeOutputDir>${replaced.deployDir}</nativeOutputDir>
            <nativeReleaseVersion>1.1.0</nativeReleaseVersion>
            <updateExistingJar>true</updateExistingJar>
            <additionalAppResources>${basedir}/target/extra-resources</additionalAppResources>
            <appName>InstructionGen</appName>
        </configuration>
    </plugin>
</plugins>
</build>

Now when i pass a property just by using mavens property-tag the nativeInstaller will be deployed to the correct location.

While this might be correlated to [question]: (Maven build-helper-maven-plugin regex unable to use property as dependency.version). That question does not support an answer in my opinion. The phase in which the replacement takes place is "validate", whereas the phase in which the javafx-maven-plugin builds the bundle is "package", so order should be correct. I used the antrun-plugin for tests to see if the property is created at all, and it is. Interesting fact: When I add something after ${replaced.deployDir} in <nativeOutputDir> like <nativeOutputDir>${replaced.deployDir}\\test</nativeOutputDir> it deploys to projectname\target\${replaced.deployDir}\test creating the non-parsed ${replaced.deployDir} folder.

Any help is appreciated.

Community
  • 1
  • 1
Wingie
  • 111
  • 1
  • 2
  • 10
  • Did you check that `replaced.deploydir` was the correct path you were expecting? Run `mvn clean validate -X` (in debug mode) to see if the value is correct. – Tunaki Oct 19 '16 at 08:58
  • I kept running using the -e and -X switch for maximum output. Path seems to be correct. The replacer resolves `${replaced.deployDir}` to `C:\\temp\\snapDir` which is what i would write into nativeOutputDir directly. – Wingie Oct 19 '16 at 09:10
  • Hmm, maybe it should replace it to `C:\temp\snapDir` instead. Can you try that? – Tunaki Oct 19 '16 at 10:41
  • Yes, I´ve tried, didn´t work. Neither did `c:/temp/snapDir`. Interesting fact: When I add something after `${replaced.deployDir}` like `${replaced.deployDir}\\test` it deploys to `projectname\target\${replaced.deployDir}\test` creating the non-parsed `${replaced.deployDir}` folder. So it is definately not being replaced. – Wingie Oct 19 '16 at 11:27

0 Answers0