On Fri, Aug 17, 2007 at 10:35:19AM -0400, Alan D. Salewski spake thus:
> On Fri, Aug 17, 2007 at 09:19:12AM -0500, Wayne Fay spake thus:
> > I don't use the SAR plugin but I think I understand the error
> > message... It looks like your dependencies define the sar as
> > <packaging>jboss-sar without a classifier... and then your EAR
> > configuration says <classifier>jboss-sar without a packaging.
> > 
> > I'd assume one of those is wrong. My guess would be to change
> > <classifier> to <packaging>.
> > 
> > Wayne
> [...]
> 
> My recent experience with the jboss-packaging-maven-plugin confirms
> Wayne's suspicion. In my particular case, simply omitting the
> 'classfier' element from the EJB <SarModule> solved the problem.
> 
> > 
> > On 8/16/07, Steve Dobson <[EMAIL PROTECTED]> wrote:
> [...]
> > > However it builds just fine if I remove the SAR information.  What am I
> > > doing wrong?
> [...]
> > >         <dependency>
> > >            <groupId>uk.org.syscall.pugwash</groupId>
> > >            <artifactId>pugwash-sar</artifactId>
> > >            <version>2.0</version>
> > >            <type>jboss-sar</type>
> > >         </dependency>
> [...]
> 
> That's fine as is.
> 
> > >                   <sarModule>
> > >                     <groupId>uk.org.syscall.pugwash</groupId>
> > >                     <artifactId>pugwash-sar</artifactId>
> > >                     <classifier>jboss-sar</classifier>
> > >                   </sarModule>
> 
> Try this, instead:
> 
>     <sarModule>
>       <groupId>uk.org.syscall.pugwash</groupId>
>       <artifactId>pugwash-sar</artifactId>
>     </sarModule>
> 
> HTH,
> -Al

[ Since I found myself again working with SAR files, and my earlier post
  turned out to be antihelp to myself (and I hope not too many others), I
  think it's only appropriate that I reply to my own busted post to set
  the record straight... ]

First, for the untainted, there are currently several different
maven-2.x plugins that purport to produce SAR files (JBoss-specific
"Service ARchives"). My comments below below pertain only to use of the
'jboss-packaging-maven-plugin' plugin, currently available in the
codehaus.org snapshots repository:

    
http://snapshots.repository.codehaus.org/org/codehaus/mojo/jboss-packaging-maven-plugin/

To configure use of the plugin, I added the following snippets to my
top-level pom.xml file:

  <project>
    <modules>
      <module>myproj-sar</module>
      <module>myproj-ear</module>
      ...
    </modules>
    ...
    <dependencyManagement>
      ...
       <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>myproj-sar</artifactId>
        <version>${project.version}</version>
        <type>sar</type>
      </dependency>
      ...
    </dependencyManagement>
    ...
    <build>
      ...
      <pluginManagement>
        <plugins>
          ...
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.3.1</version>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jboss-packaging-maven-plugin</artifactId>
            <version>2.0-SNAPSHOT</version>
          </plugin>
          ...
        </plugins>
      </pluginManagement>

      <plugins>
        ...
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>jboss-packaging-maven-plugin</artifactId>
          <!-- Enable 'jboss-sar', etc., as a recoginized maven packaging type 
-->
          <extensions>true</extensions>
        </plugin>
        ...
      </plugins>
      ...
    </build>
    ...
  </project>

In the pom.xml of the subproject that produces the SAR file, I declared
the packaging type as 'jboss-sar':

  <project>
    ...
    <artifactId>myproj-sar</artifactId>
    <packaging>jboss-sar</packaging>
    ...
  </project>

Note that the dependencyManagement entry for the SAR subproject in the
top-level pom.xml indicates type 'sar', but the packaging type declared
by the SAR subproject itself is 'jboss-sar'. During the 'install' build
phase, the SAR subproject will install the artifact with a '.sar'
extension in the local maven repository.

In the pom.xml of the subproject that produces the EAR file, I have the
following relevant snippets:

  <project>
    ...
    <dependencies>
      ...
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>myproj-sar</artifactId>
        <type>sar</type>
      </dependency>
      ...
    </dependencies>
    <build>
      <plugins>
        ...
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-ear-plugin</artifactId>
          <configuration>
            <!-- The version of the application.xml file to generate. Valid -->
            <!-- values include '1.3', '1.4', and '5'. -->
            <version>5</version>
            ...
            <modules>
              <!-- JBoss specific stuff -->
              <SarModule>
                <groupId>${project.groupId}</groupId>
                <artifactId>myproj-sar</artifactId>
              </SarModule>
              ...
            </modules>  
            ...
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>ear</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
  </project>

The things to note about this snippet are that the dependency type of
the SAR module is 'sar' (not 'jboss-sar'), and the 'SarModule' element
of the maven-ear-plugin configuration does not include a classifier.

Hope that cookbook is helpful to someone,
-Al

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to