redfish4ktc / maven-soapui-extension-plugin

This plugin adds new features and bug fixes to SmartBear plugins: soapui-pro-maven-plugin and soapui-maven-plugin.
Apache License 2.0
45 stars 22 forks source link

ClassNotFound: org /sonatype/aether/artifact/Artifact #120

Closed cloudhuang closed 10 years ago

cloudhuang commented 10 years ago

when I execute the mvn command, I encounter a error

ar failed: A required class was missing while executing com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.0:mock-as-war: org /sonatype/aether/artifact/Artifact

then I tried to add the dependency

<dependency>
            <groupId>org.sonatype.aether</groupId>
            <artifactId>aether-api</artifactId>
            <version>1.13.1</version>
        </dependency>

to my pom.xml, but the problem still existing.

redfish4ktc commented 10 years ago

hi @Huntter,thanks for using the plugin The mock-as-war goal currently only supports maven 3.0.x (see #70 and #121). Do you use maven 3.0.x when having the issue?

redfish4ktc commented 10 years ago

@Huntter, yes currently you need to use maven 3.0.x if you want to be able to use the mock-as-war goal (this is a limitiation which is documented). I will try to add support for other maven versions in the upcoming 4.6.4.1 version of the plugin, but I can not commit on this because I have to investigate to understand how to manage it.

Can you confirm me that you don't have issue when running with maven 3.0.x please?

cloudhuang commented 10 years ago

I tried 2 version of maven, one is 3.0.2, the other version is 3.0.5, but unfortunately, still encounter probles

Using maven 3.02

[ERROR] Failed to execute goal com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.0:mock-as-war (default-cli) on project ami- external-stub-services-home-app: Execution default-cli of goal com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.0:mock-as-w ar failed: Unable to load the mojo 'mock-as-war' in the plugin 'com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.0'. A requ ired class is missing: org/sonatype/aether/resolution/DependencyResolutionException

Using maven 3.0.5

[ERROR] Failed to execute goal com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.0:mock-as-war (default-cli) on project ami- external-stub-services-home-app: SoapUI has errors: null: NullPointerException -> [Help 1]

let me discuss how I use this plugin:

<plugin>
            <groupId>com.github.redfish4ktc.soapui</groupId>
            <artifactId>maven-soapui-extension-plugin</artifactId>
            <version>4.6.3.1</version>
 </plugin>
redfish4ktc commented 10 years ago

Hi, about the NPE when running with maven 3.0.5, this seems to be a bug in the plugin, could you run maven with the -e option to get the full stack trace? I suspect than one of the explodedWarDirectory or warFile parameters is null. Currently, you must configure both of them (because of the bug, only explodedWarDirectory should be mandatory)

About the issue with maven 3.0.2, I have never seen it before, I will check this later (I mainly test with maven 3.0.4 and maven 3.0.5).

About your pom configuration, I guess the doc is not clear enough and I will improve it soon to clarify the usage of the goal. Usually, I attach the war generation to a maven execution phase (see this integration test as an example: https://github.com/redfish4ktc/maven-soapui-extension-plugin/blob/master/src/it/mock-as-war_goal/common-soapui-extension.xml) I have also seen that you configure a version in your pom and use another one in your command line options

cloudhuang commented 10 years ago

Yep, the error info when using -e parameter as below maven version: Apache Maven 3.0.5 JDK version: Java version: 1.6.0_25 64bit OS: win 7

SoapUI has errors:
null
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        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:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: SoapUI has errors: null
        at org.ktc.soapui.maven.extension.MockAsWarMojo.performRunnerExecute(MockAsWarMojo.java:120)
        at org.ktc.soapui.maven.extension.AbstractSoapuiRunnerMojo.performExecute(AbstractSoapuiRunnerMojo.java:49)
        at org.ktc.soapui.maven.extension.AbstractSoapuiMojo.execute(AbstractSoapuiMojo.java:37)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.ktc.soapui.maven.extension.MockAsWarMojo.performRunnerExecute(MockAsWarMojo.java:99)
        ... 23 more
redfish4ktc commented 10 years ago

ok, thanks for the feedback, this is due to the bug we previously talked about. See also #122

I will keep this issue open and will check it again when #70 will be implemented. Otherwise, I will document that this goal does not supports maven 3.0.2

cloudhuang commented 10 years ago

Yep, working after using maven 3.0.5, thanks a lot.