[
https://issues.apache.org/jira/browse/SM-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12968571#action_12968571
]
Gavin Scott commented on SM-1957:
---------------------------------
I also see this when building an SA with maven3 using the compile goal in a
nested module project like the one described here:
http://servicemix.apache.org/4-beginner-web-services-with-servicemix-and-cxf.html
Running "mvn3 clean compile" from the top-level of the attached
tutorial-wsdl-cxf-service.tar.gz demonstrates the problem. Problem also occurs
when building with m2eclipse 0.12
In these cases the SU artifact filename is "classes" instead of something like
"my-cxf-bc-su-1.0-SNAPSHOT.jar" which causes the fileName.lastIndexOf('.')
shown above to fail.
The attached jbi-maven-plugin-su-filename.patch fixes this by generating the
.zip filename based on artifact id and version rather than mangling the SU
artifact .jar name. This is not a perfect fix because it fails if the
serviceUnitName has been overridden. See my-cxf-se-su/pom.xml in attached
tarball for an example. However, that case is broken in the current
jbi-maven-plugin as well.
> jbi-maven-plugin should not complains when calling compile goal for a
> service-assembly
> --------------------------------------------------------------------------------------
>
> Key: SM-1957
> URL: https://issues.apache.org/jira/browse/SM-1957
> Project: ServiceMix
> Issue Type: Bug
> Components: tooling
> Affects Versions: jbi-maven-plugin-4.3
> Environment: Using maven 3.0-beta1, but manifests itself with maven
> 2.2.1
> Reporter: Victor Ortega
> Assignee: Jean-Baptiste Onofré
>
> Hello,
> h1. Problem
> When calling mvn compile in a project tree and one of the project is an SA, I
> get the following error:
> {code}
> [ERROR] Failed to execute goal
> org.apache.servicemix.tooling:jbi-maven-plugin:4.3:generate-jbi-service-assembly-descriptor
> (default-generate-jbi-service-assembly-descriptor) on project scenario1-sa:
> Execution default-generate-jbi-service-assembly-descriptor of goal
> org.apache.servicemix.tooling:jbi-maven-plugin:4.3:generate-jbi-service-assembly-descriptor
> failed: String index out of range: -1 -> [Help 1]
> {code}
> h1.
> The errors seems to be coming from
> [GenerateServiceAssemblyDescriptorMojo.java|http://svn.apache.org/repos/asf/servicemix/maven-plugins/jbi-maven-plugin/trunk/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java],
> line 213, for the following part:
> {code:java}
> fileName = fileName.substring(0, fileName.lastIndexOf('.')) + ".zip";
> {code}
> This piece of code seems to try to generate the jbi.xml file using the name
> of the files of the SU plugins generated by the goal package.
> h1. Expected Result
> I would expect jbi-maven-plugin, either not to try to generate the jbi.xml
> file on compile, or to generate it without using the information about things
> that are produced by the goal package.
> h1. Rational for using compile
> # because I want to do it :)
> # to compile all the projects in a project tree without bothering
> # to run tests !!
> # to use the project in Eclipse with m2eclipse (Eclipse the goal compile from
> time to time and the error appears in its console)
> Thank you
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.