如果 jboss 版本是 4.2,maven-ear-plugin 可以工作,但如果是 5,则不行。为什么?
我正在使用 maven 来配置 maven-ear-plugin。当我说 jboss 版本是 5 时,我收到以下异常(请参阅下面的代码,在标签下)。如果我将版本替换为 4.2,它就可以工作。
<build>
<finalName>tactical</finalName>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>5</version>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
<jboss>
<version>5</version>
<loader-repository>seam.jboss.org:loader=tactical</loader-repository>
</jboss>
<modules>
<ejbModule>
<groupId>${project.groupId}</groupId>
<artifactId>tactical-jar</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
为什么它在 jboss 4.2 上工作正常,但在 5 上却不行。什么?
我得到以下异常:
[INFO] Failed to initialize JBoss configuration
Embedded error: Invalid JBoss configuration, version[5] is not supported.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to initialize JBoss configuration
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:49
9)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a: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:597)
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 JBoss configuration
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:159)
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.EarPluginException: Invalid JBoss configuration, version[5] is not supported.
at org.apache.maven.plugin.ear.JbossConfiguration.<init>(JbossConfiguration.java:95)
at org.apache.maven.plugin.ear.AbstractEarMojo.initializeJbossConfiguration(AbstractEarMojo.java:296)
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:155)
... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
任何想法。 谢谢
I am using maven to configure maven-ear-plugin. I am getting following exception when I say jboss version is 5 (See below code, under tag). It works if I replace version to 4.2
<build>
<finalName>tactical</finalName>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<version>5</version>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
<jboss>
<version>5</version>
<loader-repository>seam.jboss.org:loader=tactical</loader-repository>
</jboss>
<modules>
<ejbModule>
<groupId>${project.groupId}</groupId>
<artifactId>tactical-jar</artifactId>
</ejbModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
Why it works fine for jboss 4.2 but not for 5. What ??
I get the following exception:
[INFO] Failed to initialize JBoss configuration
Embedded error: Invalid JBoss configuration, version[5] is not supported.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to initialize JBoss configuration
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:49
9)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a: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:597)
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 JBoss configuration
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:159)
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.EarPluginException: Invalid JBoss configuration, version[5] is not supported.
at org.apache.maven.plugin.ear.JbossConfiguration.<init>(JbossConfiguration.java:95)
at org.apache.maven.plugin.ear.AbstractEarMojo.initializeJbossConfiguration(AbstractEarMojo.java:296)
at org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:155)
... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
Any idea.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用的是哪个版本的插件?最新源代码 表明这应该有效。
Which version of the plugin are you using ? The latest source code suggests this should work.
maven Ear 插件 2.3.2 及更高版本中提供了对 JBoss 5 的支持(请参阅 MEAR -102)。使用您当前的配置(不指定插件的版本,为了构建可重复性,不建议这样做),您将获得该插件的版本 2.3.1。您可以通过运行打印“有效的 pom”来检查这一点:
在您的情况下,我建议使用最新版本:
The support of JBoss 5 is available in version 2.3.2 and later of the maven ear plugin (see MEAR-102). With your current configuration (without specifying the version of the plugin, which is not recommended for the sake of build reproducibility), you get the version 2.3.1 of the plugin. You can print the "effective pom" to check this by running:
In your case, I suggest to use the latest version: