[jboss-user] [JBoss/Spring Integration] - Re: help on jboss spring integration
mattlf
do-not-reply at jboss.com
Sun Nov 16 19:59:58 EST 2008
Unfortunately I can't upgrade to Jboss5 and need to get it done with Jboss4
Thank you again for your reply and again I 'll ask for a little bit more help:
How to get the EAR to package the .spring ?
Here is what I did:
I modified MYPROJECT-IMPL-JAR so that it generates a .spring artefact. In order to do that, I added the following to the POM of MYPROJECT-IMPL-JAR
<plugin>
| <groupId>org.codehaus.mojo</groupId>
| <artifactId>jboss-packaging-maven-plugin</artifactId>
| <!-- Enable packaging types and lifecycle bindings. -->
| <extensions>true</extensions>
| <configuration>
| <archiveName>MYPROJECT-IMPL-JAR</archiveName>
| <deploymentDescriptorFile>src/main/resources/META-INF/jboss-spring.xml</deploymentDescriptorFile>
| </configuration>
| <executions>
| <execution>
| <phase>package</phase>
| <goals>
| <goal>spring</goal>
| </goals>
| </execution>
| </executions>
| </plugin>
|
But I am not sure how to declare the module & dependency into the EAR
I did the following to the POM of MYPROJECT-EAR
<build>
| <finalName>MYPROJECT-EAR-1.0</finalName>
| <defaultGoal>package</defaultGoal>
| <!-- resources>
| <resource>
| <directory>../src/main/resources/META-INF</directory>
| <targetPath>META-INF</targetPath>
| <filtering>true</filtering>
| <includes>
| <include>jboss-spring.xml</include>
| </includes>
| </resource>
| </resources -->
| <plugins>
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-ear-plugin</artifactId>
| <version>2.3.1</version>
| <configuration>
| <jboss>
| <version>4.2</version>
| <loader-repository>
| com.strateer.repositoryloader:loader=myproject-ear
| </loader-repository>
| </jboss>
|
| <defaultLibBundleDir>lib</defaultLibBundleDir>
| <modules>
| <ejbModule>
| <groupId>com.strateer.myproject</groupId>
| <artifactId>MYPROJECT-EJB-JAR</artifactId>
| </ejbModule>
| </modules>
| </configuration>
| </plugin>
| </plugins>
| </build>
|
| <dependencies>
|
| <dependency>
| <groupId>com.strateer.myproject</groupId>
| <artifactId>MYPROJECT-EJB-JAR</artifactId>
| <version>${applicationVersion}</version>
| <type>ejb</type>
| </dependency>
|
| <dependency>
| <groupId>com.strateer.myproject</groupId>
| <artifactId>MYPROJECT-IMPL-JAR</artifactId>
| <version>${applicationVersion}</version>
| <type>spring</type>
| </dependency>
|
| </dependencies>
|
but compilation throws an error Unknown artifact type[spring]
Here is the trace
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to initialize ear modules
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to initialize ear modules
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:210)
at org.apache.maven.plugin.ear.GenerateApplicationXmlMojo.execute(GenerateApplicationXmlMojo.java:96)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: org.apache.maven.plugin.ear.UnknownArtifactTypeException: Unknown artifact type[spring]
at org.apache.maven.plugin.ear.util.ArtifactTypeMappingService.getStandardType(ArtifactTypeMappingService.java:159)
at org.apache.maven.plugin.ear.EarModuleFactory.newEarModule(EarModuleFactory.java:65)
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:203)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189691#4189691
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189691
More information about the jboss-user
mailing list