问题标签 [cargo-maven2-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
374 浏览

java - 通过 cargo maven 插件在 Wildfly 上部署的战争应用程序中不可能进行 EJB 注入

我使用 cargo maven 插件(wildfly 10 应用服务器)部署了一个战争应用程序,这成功发生了!但我不能在课堂上注入 ejb。这是我执行货物时的控制台:运行(请参阅日志尾部的空实例..)

我的 ejb 是 Timer2EJB:

pushEndpoint 实现了 Runnable。但是当我执行这个类时,注入不会发生:

如果我在 @EJB 之前添加 (lookup="java:global/dwrexmio/TimerEjb2!com.cadit.bean.TimerEjb2") 相同的东西

在 webapp\WEB-INF 中有 web.xml 和 beans.xml 和 ejb-jar.xml:

这是我的 pom.xml:

怎么了?

非常感谢!

罗比

0 投票
1 回答
538 浏览

java - 使用 cargo 插件时无法在 tomcat8 上部署应用程序

我正在使用 cargo 插件来配置 Tomcat。但我无法启动我的应用程序。在点击应用程序 URL 时获得 400。

pom.xml 中的 cargo 配置如下所示:

在点击 URL http://localhost:4080/cargocpc/index.html时,我得到了货物主页。但是在点击http://localhost:4080/abc时,我得到了 400。

如我所见,下面提到的目标文件夹的结构,abc 文件夹(abc 是我的应用程序的名称)在目标内部与 catalina-base 平行扩展,但 cargocpc 在 /catalina-base/webapps 内部扩展。在此处输入图像描述

webapps中没有abc文件夹可以成为400 Bad request的原因吗?

配置有什么问题吗?如果 abc 文件夹应该在 webapps 中展开,应该做哪些配置?

0 投票
0 回答
683 浏览

jakarta-ee - 与 Arquillian 的集成测试导致 Wildfly10 上的重复层“基础”

我在使用wildfly 10x 嵌入式容器使用maven failsafe-plugin 运行集成测试时遇到问题。嵌入式容器由 Cargo maven 插件组成和运行。这些插件下载wildfly服务器,安装它,并在集成测试阶段前后启动和停止wildfly容器。对于 IT 我使用 Arquillian 并且在这个阶段我得到一个例外:

JDK 1.8、JEE 8、IntelliJ IDEA 2017.2.5 maven pom 由 3 个配置文件组成:

在我的属性之外,您可以找到带有 skipTest =true 的surefire插件(目前),仅用于不需要企业容器的 Junit 测试。

我的 pom.xml 和 Arquillian xml 文件显示在这里,怎么了?感谢您的建议


如果我在没有 arquillian 的情况下运行容器,则不会发生异常。

0 投票
0 回答
55 浏览

java - 货物插件的多次战争

我在根 POM.xml 中使用这样的配置

但这会导致

Artifact [com.x:store:war] 不是项目的依赖项。-> [帮助 1]

我什至试图包含在这个 POM.xml 中

我该如何解决这个问题?

0 投票
1 回答
94 浏览

maven - 无需从存储库获取依赖项即可自动部署 EAR 项目

是否可以将工件 ( .ear) 部署到应用程序服务器 (AS) 中而无需从存储库中获取其依赖项?

让我解释一下:我尝试配置以部署到 AS 的 maven 项目有 3 个模块:

  1. 网络(.war- 前端)
  2. EJB(.ejb-后端)
  3. 实体(.jar- 实体类)

这些模块被包装到一个 EAR 模块中,并且在某些存储库(如 Nexus 或 JFrog Artifactory)中都不可用。当我尝试使用 Cargo Maven 插件或 JBoss Deployment Maven 插件时,两者都通知无法解析这些模块的依赖关系。


已更新(2019 年 3 月 1 日)

该问题类似于以下链接的第 6 项和第 7 项中引用的问题:http ://webdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/html/ejb-basicex-eardeploy.html#ejb- basicex-eardeploy-testmodule

0 投票
0 回答
57 浏览

spring-boot - When I do "mvn verify", I cannot get the spring-boot project to load the application properties

My project is on an isolated computer, so I can't do massive dumps of files, but I will try to provide the necessary information.

I have a Spring-Boot MVC project. I can get it to run fine from the command line. I can get the ApplicationContext to fun fine as long as I am using the Spring-Boot-Test starter:

I have recently added some HTMLUnit tests to go do some integration testing. The tests run fine when I have the application already running (which means it can't be done automatically on the corporate Bamboo). So, after stumbling around the web, I added the cargo plugin:

I also went to the maven failsafe plugin and did:

Finally I edited the spring-boot-maven-plugin and added:

So, I can finally see my application context start up when I do a "mvn verify". All is well and good, right up until it tries to connect to the database. I have 2 application.properties files and a application-test-h2.properties.

They are:

It appears from the error message that it is only picking up the application.properties noted by (1). The cargo startup does not appear to be getting (2) or (3) or using the precedence Spring projects use.

The integration tests are simple:

So the $64,000 question is, how do I get the properties to all resolve in the cargo plugin?

Thank you in advance.

0 投票
0 回答
190 浏览

java - 如何向 cargo 提供 Spring application.properties 文件,以便我的应用程序上下文正确启动?

我正在向我的 Spring-Boot 应用程序添加货物和故障保护。

故障保护:太好了。只要我运行本地主机,就可以找到我的 1 个 IT 并运行它。到目前为止,我已经在本地运行它,然后运行 ​​IT。

maven:也很棒。它以最少的麻烦正确构建

货物:我快疯了。

我有 3 个 Spring-Boot 应用程序解析的属性文件。一切正常,当我使用 SpringBootTest 进行单元测试时,一切都很好。(我在 /src/main/resources 中有一个 application.properties,在 /src/test/resources 中有一个测试版本,然后在我的 jar 之外有第三个版本。)

当我尝试在 cargo 中启动应用程序时,只加载了 /src/main/resources。我要疯了,试图弄清楚如何提供其他两个文件。

我试过了:

  1. 试过了
  1. 我尝试在我的 IDE 中添加参数。这行得通,但我不想将所有这些都放在命令行上,因为会有一些安全问题。

  2. 我尝试添加到 systemProperties,但这不适用于 spring 属性。

如何为货物指定弹簧属性(不是 -Dsystem.properties)?这将在企业 Bamboo 上进行,除此之外的一切都有效。我什至用 JaSypt 加密了敏感属性,这样它们就不会在明文中徘徊。我想我可以重新运行验证任务并在那里的命令行上使用 spring 参数,但如果它只使用 Spring 属性会更好。

必须有一种方法可以提供不破坏其他所有内容的货物参数?

编辑和添加 我希望为前端做 Selenium/HTMLUnit 测试。 @SpringBootTest不适用于这些自动化测试,因此应用程序属性正在被破坏。常规测试(即mvn test)工作正常。应用程序(即java -jar MyApp.jar)的运行工作正常,并且使用内部的嵌入式 Tomcat 就好了。我正在寻找一个可以运行的设置,mvn verify在某种背景下启动应用程序(例如货物?),然后运行测试。

我承认我不熟悉前端测试。如果货物仍然不是正确的工具,那么我将不胜感激关于什么是正确的工具。

0 投票
0 回答
65 浏览

maven-cargo - Codehaus Cargo 缺少日志记录子系统

我在使用 Codehaus Cargo v18 运行测试时遇到问题。虽然 Wildfly 18.0.1 允许我没有日志子系统standalone.xml- 所以我可以将所有日志记录配置放在 logging.properties 中,但当我使用以下命令运行 C​​argo v18 时,它在部署时失败standalone.xml

如何避免设置此类子系统模块并logging.properties直接在 Cargo 中使用?

0 投票
1 回答
129 浏览

maven - Jenkins 中 Cargo Container 中的 Tomcat 下载问题

我在 Jenkins 中面临以下错误(我正在使用带有 tomcat 的货物插件进行集成测试)。

[2021-07-20T09:46:47.790Z] [错误] 无法在项目 demo-prj-rest-test 上执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.7.9:start (start-server) : 目标 org.codehaus.cargo:cargo-maven2-plugin:1.7.9:start failed 的执行 start-server: 下载失败 [https://repo.maven.apache.org/maven2/org/apache/tomcat/ tomcat/8.0.42/tomcat-8.0.42.zip]:java.net.ConnectException:连接超时(连接超时)-> [帮助 1]

下面是我的货物插件:

这在本地 maven 构建中完美运行,所有集成测试在 cargo tomcat 中成功运行,但在 Jenkins 构建中面临上述问题。

0 投票
1 回答
37 浏览

deployment - 使用 cargo 插件在 payara 上部署

我想用 cargo-maven2-plugin 部署我的 War,但它不像预期的那样工作。当我第一次部署时,它可以工作,但是当我第二次部署时,执行取消部署后出现错误。

org.apache.maven.lifecycle.LifecycleExecutionException: 无法执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.7.16:redeploy (deploy) on project XXX-deploy: 目标 org.codehaus.cargo 的执行部署: cargo-maven2-plugin:1.7.16:重新部署失败:部署失败:null

这是我的代码:

'''