4 Replies Latest reply on Mar 20, 2012 2:10 PM by ahw-dev

    JBoss WS Dependencies with Maven ending up with truncated MANIFEST.MF

    ahw-dev

      I am trying to consume a Web Service from an EJB and therefore am trying to use the JBoss CXF implementation Client classes.

       

      Per this very nice article -

       

      https://community.jboss.org/wiki/JBossWS-AS7FAQ

       

      I have customized a MANIFEST.MF file to include the following dependencies:

       

      org.jboss.ws.cxf.jbossws-cxf-client services export, org.apache.ws.security services export, org.apache.ws.xmlschema services export with the final DESIRED output of my MANIFEST.MF file being:

       

      Manifest-Version: 1.0

      Built-By: ahw001

      Build-Jdk: 1.6.0_29

      Created-By: Maven Integration for Eclipse

      Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export, org.apache.ws.security services export, org.apache.ws.xmlschema services export

       

      However Maven seems to have a column (field?) limitation on a key/value field of 70 characters so when I actually do the Maven deploy the output actually ends up like this:

       

      Manifest-Version: 1.0

      Built-By: ahw001

      Build-Jdk: 1.6.0_29

      Created-By: Maven Integration for Eclipse

      Dependencies: org.jboss.ws.cxf.jbossws-cxf-client services export, or

      g.apache.ws.security services export, org.apache.ws.xmlschema service

      s export

       

      Which obviously is not correctly parsable and does not end up with a working distribution. When I manually go in and edit the MANIFEST.MF file after the deployment to concatonate the entry everything works fine.

       

      My question is, does anyone know a way around this issue with Maven? Or can I (should I) add the other dependencies to the org.jboss.ws.cxf.jbossws-cxf-client module.xml file? Will that break any JBoss WS upgrades?

       

      Thanks in advance,

       

      Adam

        • 1. Re: JBoss WS Dependencies with Maven ending up with truncated MANIFEST.MF
          ahw-dev

          By the way here is my Maven build section:

           

          <build>
              <finalName>rich-test</finalName>
              <plugins>
                  <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>2.3.2</version>
                  </plugin>
                  <plugin>
                      <artifactId>maven-war-plugin</artifactId>
                      <version>2.1.1</version>
                     
             <configuration>
            <archive>
            <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
                      <!--
              <manifestEntries>
                  <Dependencies>${jboss.dependencies}</Dependencies>
                      </manifestEntries>
                      -->
                  </archive>
                </configuration>
                  </plugin>
              </plugins>
          </build>

           

          It doesn't matter whether i try and include a key/value pair as an entry or specify a pre-created MANIFEST.MF file. In either circumstance Maven truncates the Dependencies line.

          • 2. Re: JBoss WS Dependencies with Maven ending up with truncated MANIFEST.MF
            asoldano

            This looks like a limitation in the maven war/jar plugin (I assume that's what you're using).

            As far as workarounds are concerned, I would suggest having a look at https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7 , in particular the section on using a custom jboss-deployment-structure.xml for setting the module dependencies.

            Modifying the org.jboss.ws.cxf.jbossws-cxf-client module.xml is also going to work (of course it would affect any other deployment you declared that dependency in), but of course you changes are being overwritten if you upgrade jbossws.

            • 3. Re: JBoss WS Dependencies with Maven ending up with truncated MANIFEST.MF
              ahw-dev

              Thanks for the fast response. I will play around wth the jboss-deployment-structure.xml file and see if I can solve my problem that way.

              • 4. Re: JBoss WS Dependencies with Maven ending up with truncated MANIFEST.MF
                ahw-dev

                I was able to solve the Maven MANIFEST (bug?) by adding the dependencies to the jboss-deployment-structure.xml file, and am updating this in case Google brings anyone else here.

                 

                <jboss-deployment-structure>

                  <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->

                  <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

                  <!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->

                  <!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     -->

                  <deployment>

                    <!-- Exclusions allow you to prevent the server from automatically adding some dependencies    

                    <exclusions>

                        <module name="org.javassist" />

                    </exclusions>

                    -->

                    <!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->

                    <dependencies>

                      <module name="org.jboss.ws.cxf.jbossws-cxf-client services export" />

                      <module name="org.apache.ws.xmlschema services export" />

                      <module name="org.apache.ws.security services export" />

                    </dependencies>

                    <!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory

                    <resources>

                      <resource-root path="my-library.jar" />

                    </resources>

                    -->

                  </deployment>

                 

                 

                </jboss-deployment-structure>