Open ShahinKordasti opened 9 years ago
Not sure if this is related to this issue: https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
Hi @Shakor I suspect you have the same issue than what is discribed in #120 and yes, this is something related to AetherClassNotFound.
The mock-as-war
goal currently only supports maven 3.0.x (see #70 and #121). This is a limitiation which is documented
Tell me if something is not clear in the doc, I can uprove it.
Hello, thanks for the info. I downgraded to maven 3.0.5 and now it works. I did not see in the Git Hub read me that only maven 3.0.x is supported and not higher versions, maybe that should be more clear there.
Also I kind of lacked a complete example. I now there are some under the git hub IT folder but it has so much stuff in there so I was not sure if I needed all of that or not. A simple, complete example would be very useful. For example, I still dont know how to add your own web.xml (if you even can) to the produced war or how to have it installed by maven in the repository as mvn clean install does not seem to do it by itself.
Ok thanks for the feedback, The limitation is described in the Goals page, but maybe this is not enough About providing examples, the readme has a link to the mock-as-war dedicated page where you already have examples.
About
Thanks, would very much appreciate an example for how to get it installed. Because if I set the package type of the maven module to war then it complains about not having a web.xml. If I remove the package type, it only installs the jar and not the war being produced by the plugin :/
I know you can specifically install an artifact by adding paramters to the maven command but as this module is being built as part of an aggregated maven project I would like that a simple 'mvn install' installs the war.
If anyone is interested I solved the war installation by adding the following to my pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>install-war</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<packaging>war</packaging>
<artifactId>${project.artifactId}</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<file>${project.build.directory}/${project.build.finalName}.war</file>
</configuration>
</execution>
</executions>
</plugin>
Hi, I have added a new example. Instead of installing the file, I attach the war as project artifact.
I have also updated the mock-as-war dedicated page: it now has a warning about maven 3.0.x only support.
Tell me if it is clear for you
I tried using this plugin to create a war of our soap ui xml file and when I run it I get:
[WARNING] Error injecting: org.ktc.soapui.maven.extension.MockAsWarMojo java.lang.NoClassDefFoundError: org/sonatype/aether/artifact/Artifact ... [ERROR] Failed to execute goal com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.1:mock-as-war (uis-stub-war) on project xxx-uis-stub: Execution uis-stub-war of goal com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.1:mock-as-war failed: A required class was missing while executing com.github.redfish4ktc.soapui:maven-soapui-extension-plugin:4.6.4.1:mock-as-war: org/sonatype/aether/artifact/Artifact
I tried adding a bunch of dependencies, including sonatype aether but it did not fix it. My pom.xml looks like this:
I am using maven 3.2.3