Forum Discussion

pembertonrw's avatar
pembertonrw
Contributor
11 years ago

Maven Build Failing Following Upgrade to 5.0.0

I have attempted to upgrade the maven plugin from 4.6.4 to 5.0.0 however the build now fails due to:

Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.0.0:test (default-cli) on project SomeAutomatedUITests: Execution default-cli of goal com.smartbear.soapui:soapui-maven-plugin:5.0.0:test failed: Plugin com.smartbear.soapui:soapui-maven-plugin:5.0.0 or one of its dependencies could not be resolved: Could not find artifact javafx:jfxrt:jar:2.2 at specified path /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/jre/lib/jfxrt.jar ->

The only thing that has changed is the version of soapUI that I am running, if I then revert it back to the previous version it then works OK. Is there something else I need to add to the pom to get this working with the new version?

12 Replies

  • MCS's avatar
    MCS
    New Contributor

    You can solve the issue without modifying your local JDK by including the maven-soapui-plugin like this:

    <properties>
        <version.soapui>5.1.3</version.soapui>
    </properties>
    <build>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>${version.soapui}</version>
            <dependencies>
                <dependency>
                    <groupId>com.smartbear.soapui</groupId>
                    <artifactId>soapui</artifactId>
                    <version>${version.soapui}</version>
                    <exclusions>
                        <exclusion>
                            <groupId>javafx</groupId>
                            <artifactId>jfxrt</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
            <!-- ... -->
        </plugin>
    </build>

    That should work if you don't use features that need the JavaFX runtime (OAuth2?!).

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Thanks for sharing your workaround
    The plugin is supposed to work with Oracle/Sun JDK 6, but because of this javafx dependency, it fails working out of the box

    I am asking if javafx should not be exclude from the dependencies of the maven plugin.
    Prior to version 5, SoapUI relied on teamdev jxbrowser for browsing features and jxbrowser dependencies were excluded from the plugin dependencies. So I guess, they were not usefull to run the plugin, especially because in that case, we do not use browsing. As javafx is now used in place of jxbrowser, I guess it should now be excluded.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    SoapUI needs to be able to locate the file jfxrt.jar (the JavaFX runtime), and will look in the default location inside your Java 7 installation. Since you're running OpenJDK, I suppose you may not even have a JavaFX runtime installed, but if you have the file somewhere on your file system, you can set the system property javafx.runtime.lib.jar to the location of this file, e.g. like so:

    mvn -Djavafx.runtime.lib.jar=/path/to/jfxrt.jar clean install

    Kind regards,
    Manne, SoapUI developer
  • Ok I have tried the following command mvn -Djavafx.runtime.lib.jar=/some/location/jfxrt.jar clean -f ./MyProject/pom.xml com.smartbear.soapui:soapui-maven-plugin:test but it is still trying to go to the other folder location?
  • ipstefan's avatar
    ipstefan
    Occasional Contributor
    SmartBear Support wrote:
    SoapUI needs to be able to locate the file jfxrt.jar (the JavaFX runtime), and will look in the default location inside your Java 7 installation. Since you're running OpenJDK, I suppose you may not even have a JavaFX runtime installed, but if you have the file somewhere on your file system, you can set the system property javafx.runtime.lib.jar to the location of this file, e.g. like so:

    mvn -Djavafx.runtime.lib.jar=/path/to/jfxrt.jar clean install

    Kind regards,
    Manne, SoapUI developer


    According to
    http://openjdk.java.net/projects/openjfx/
    http://stackoverflow.com/questions/2251 ... r-on-linux
    http://stackoverflow.com/questions/1854 ... nd-openjdk
    JavaFx is not available in OpenJdk and will not be for the following months.

    It is suggested that Oracle JDK is installed for the JavaFx.
    Latest Oracle JDK version on the official repository is 7. You can install 8 by downloading it directly from the oracle site or by installing from a 3rd party repository.
    For Oracle 8 though the path to the jfxrt.jar changed to: jre/lib/ext
  • ipstefan's avatar
    ipstefan
    Occasional Contributor
    Did all the above(including giving the parameter to my jenkins build) - I am receiving the following error:

    14:20:53 [ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.0.0:test (default) on project soapui-maven-plugin: Execution default of goal com.smartbear.soapui:soapui-maven-plugin:5.0.0:test failed: An API incompatibility was encountered while executing com.smartbear.soapui:soapui-maven-plugin:5.0.0:test: java.lang.UnsupportedClassVersionError: javafx/application/Platform : Unsupported major.minor version 52.0
    14:20:53 [ERROR] -----------------------------------------------------
    14:20:53 [ERROR] realm = plugin>com.smartbear.soapui:soapui-maven-plugin:5.0.0

    What I solved this with was to get(copy) the jfxrt.jar from oracle jdk 7/jre/lib to the default openjdk folder path where soapui-maven-plugin is looking.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi Joel,
    thanks for the additional information

    beside that, could it be possible to have a workaround in the plugin documentation to mitigate the issue when not running with oracle jdk 7 and 8? or exclude the dependency and document when it is needed and how/when to add it to the plugin definition?

    Thanks
    • David_LU's avatar
      David_LU
      New Contributor

      Using:

      - SoapUi 5.13

      - Java "1.7.0_71"

      - Maven 3.2.5

      I get the same issue in my log: com.eviware.soapui.SoapUI:Could not find jfxrt.jar. Internal browser will be disabled.

       

      • David_LU's avatar
        David_LU
        New Contributor

        I partially solved my issue with:

        <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>javafx</artifactId>
        <version>2.2</version>
        <scope>system</scope>
        <systemPath>C:/Program Files/Java/jre7/lib/jfxrt.jar</systemPath>
        </dependency>