Eric, I'm getting to this a little late as it appears you've already created the plugin, but there are the jboss-sar and jboss-packaging plugins over at mojo.codehaus.org that, more or less, do what you have done. The jboss-packaging plugin is intended to supercede the jboss-sar plugin and support SAR, HAR, PAR, .spring, etc JBoss deployable packagings. It would be nice to combine your WSR code into that plugin.
There is currently a problem with the jboss-packaging plugin though. Since all these packagings are JBoss-specific, I've been trying to use packaging values jboss-sar, jboss-har, etc. instead of simply sar, har, etc to denote their specific usage. Unfortunately, the packaging appears to be coupled to the deployed artifact extension (e.g., deploying a jboss-sar packaged project, uses jboss-sar as the dpelyed artifact extension), which makes a bit of sense, but is limitting. Since all these packagings are just jar files with a specific deployment descriptor and file extension, perhaps they all should be considered attached artifacts with the promary artifact being the jar. This would at least solve the packaging/deploy extension coupling "problem". Sorry some of this is OT to maven-dev, but I'd really like to see the jboss-packaging mojo inherit your WSR code, and be stablized for a release. Regards, Doug On 10/7/06, Swenson, Eric <[EMAIL PROTECTED]> wrote:
Thanks very much, Wendell. I finally have everything working correctly. I actually had two things wrong -- I didn't have the <extension> in my project's pom and the life-cycle (<component-set>) in my plugin had a couple mistakes. Thanks again for your help. -- Eric -----Original Message----- From: Wendell Beckwith [mailto:[EMAIL PROTECTED] Sent: Saturday, October 07, 2006 3:09 AM To: Maven Developers List Subject: Re: Creating a .wsr file artifact IIRC those are "standard" mappings and they are defined inside the components.xml defined in the maven-core plugin in your <maven home>/lib directory. Because your plugin is not a "standard" plugin you have to use the <extension> element with your plugin declaration in the pom of the project that uses the maven-wsr-plugin so that maven knows to look for lifecycle enahncements in the plugin. Wb On 10/7/06, Swenson, Eric <[EMAIL PROTECTED]> wrote: > > I looked in both the maven-jar-plugin and the maven-war-plugin and don't > see any components.xml. Yet these both appear to define a default life > cycle mapping (somehow). -- Eric > > -----Original Message----- > From: Swenson, Eric > Sent: Friday, October 06, 2006 11:56 PM > To: Maven Developers List > Subject: RE: Creating a .wsr file artifact > > Thanks Nathan. But I'm still not getting anywhere. I assume what > you're saying is that I need to add a META-INF/plexus/components.xml to > my plugin jar. I've done that (but perhaps the contents is still not > right), but I still get the error message, upon doing an "mvn compile" > or "mvn package" that says: > > [INFO] Cannot find lifecycle mapping for packaging: 'wsr'. > Component descriptor cannot be found in the component repository: > org.apache.maven.lifecycle.mapping.LifecycleMappingwsr. > > If I do see the META-INF/plexus/components.xml in my maven-wsr-plugin > jar file. > > Also, I modeled my maven-wsr-plugin after maven-war-plugin (I started > with the same codebase and removed the web.xml-related stuff and > replaced with web-service.xml-related stuff). And maven-war-plugin > doesn't have a components.xml in it. So why does maven-war-plugin allow > me to do "mvn compile" and "mvn package" but maven-wsr-plugin doesn't? > Is there some other registry that needs updating? When I install the > plugin in the repository, do I need any special steps or is the "mvn > install" (on the maven-wsr-plugin project) enough? > > Thanks. -- Eric > > -----Original Message----- > From: Nathan Beyer [mailto:[EMAIL PROTECTED] > Sent: Friday, October 06, 2006 9:43 PM > To: Maven Developers List > Subject: Re: Creating a .wsr file artifact > > Check out the CustomArtifactHandler part of this guide [1]. I think > what you're missing is an "extension" [2] element in your POM. > > -Nathan > > [1] > http://maven.apache.org/guides/introduction/introduction-to-the-lifecycl > e.html > [2] > http://maven.apache.org/ref/current/maven-model/maven.html#class_extensi > on > > On 10/6/06, Swenson, Eric <[EMAIL PROTECTED]> wrote: > > Well, I've made progress since my post. However, I still have an > issue. > > I now have a maven-wsr-plugin, which I based on maven-war-plugin and > I'm > > able to compile my project with: > > > > mvn compiler:compile > > > > and package my project (into a .wsr file) with: > > > > mvn wsr:wsr > > > > However, what I can't do is perform the compile/package/install > > automatically by simply doing: > > > > mvn install > > > > This works for jar and war files. But for my wsr files, it doesn't. > > When I attempt either an: > > > > mvn compile > > > > or > > > > mvn install > > > > I get the error: > > > > $ mvn compile > > [INFO] Scanning for projects... > > [INFO] > > > ------------------------------------------------------------------------ > > ---- > > [INFO] Building NemoPersonalizationService > > [INFO] task-segment: [compile] > > [INFO] > > > ------------------------------------------------------------------------ > > ---- > > [INFO] > > > ------------------------------------------------------------------------ > > [ERROR] BUILD ERROR > > [INFO] > > > ------------------------------------------------------------------------ > > [INFO] Cannot find lifecycle mapping for packaging: 'wsr'. > > Component descriptor cannot be found in the component repository: > > org.apache.maven.lifecycle.mapping.LifecycleMappingwsr. > > > > or > > > > $ mvn install > > [INFO] Scanning for projects... > > [INFO] > > > ------------------------------------------------------------------------ > > ---- > > [INFO] Building NemoPersonalizationService > > [INFO] task-segment: [install] > > [INFO] > > > ------------------------------------------------------------------------ > > ---- > > [INFO] > > > ------------------------------------------------------------------------ > > [ERROR] BUILD ERROR > > [INFO] > > > ------------------------------------------------------------------------ > > [INFO] Cannot find lifecycle mapping for packaging: 'wsr'. > > Component descriptor cannot be found in the component repository: > > org.apache.maven.lifecycle.mapping.LifecycleMappingwsr. > > > > If my pom uses <packaging>jar</packaging> > > > > I'm able to use "mvn compile" or "mvn package" or "mvn install". > > > > How can I enable this for my maven-wsr-plugin (e.g. pom files with > > <packaging>wsr</packaging>? > > > > -- Eric > > > > > > > > -----Original Message----- > > From: Swenson, Eric > > Sent: Friday, October 06, 2006 5:53 PM > > To: dev@maven.apache.org > > Subject: Creating a .wsr file artifact > > > > I'm using Maven 2.0.4 and need to produce a .wsr file. A .wsr file is > a > > jboss web service archive and is very similar to a .war file, a .sar > > file, and an .ear file. I've tried two tacts so far, neither > > successful. > > > > > > > > The first approach was to take the mavin-war-plugin sources, renaming > > all instances of "war" to "wsr" and using it. I had to make a copy of > > the WarArchiver class (org.codehaus.plexus.archiver.WarArchiver) and > > rename it, too, to WsrArchiver in order to get the generated > plugin.xml > > to not refer to WarArchiver. However, I was never able to get this > > plugin to work. I kept getting errors telling me that the life cycle > > manager could not find a mapping for "wsr". > > > > > > > > I gave up and tried to figure out how to get maven to simply rename > the > > artifact after the package goal - I went back to using war files. I > > wanted to simply rename this from a war file to a wsr file. But I > could > > never figure out how to do that. It would appear that the <format> in > > an <assembly> (I used "zip") also dictated the file extension placed > on > > the output of the assembly. > > > > > > > > Can someone give me some hints on how to accomplish what I need to do? > > I would actually like to get the mavin-wsr-plugin to work because I'd > > like to be able to add more wsr-related smarts to the packaging (there > > are additional files in a wsr that are not in a war). But I can't > > figure out how to get a copy of mavin-war-plugin to work with the > *only* > > change being that the file extension of the artifact is changed to > "wsr" > > (from "war"). > > > > > > > > Can anyone help? -- Eric > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]