问题标签 [exec-maven-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 回答
2192 浏览

maven-2 - exec-maven-plugin 想要将 maven.dependency.classpath 作为我的 EXEC 目标中的变量传递

0 投票
3 回答
2839 浏览

java - 如何在 Maven 目标目录的 JAR 文件中运行 java 类?

我想在 maven 构建之后运行我的 Izpack 安装程序,但是在执行“mvn test”之后我得到了以下输出:

看起来我必须以某种方式将生成的 jar 文件放入类路径中,有什么想法吗?

摘自我的 pom.xml :

Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java 版本:1.6.0_20 Java 主页:C:\Java\jdk16\jre 默认语言环境:en_GB,平台编码:Cp1252 操作系统名称: “windows xp”版本:“5.1”拱:“x86”系列:“windows”

马丁

0 投票
3 回答
9135 浏览

java - maven-exec-plugin 无缘无故抛出异常

我在 Maven 项目的根目录中的 Windows shell 中键入以下内容,该项目包含一个具有

公共静态无效主要(字符串 [] 参数)

我想运行的方法。

mvn exec:java -Dexec.mainClass="com.spp.config.main.SqlGeneratorHarness" -e

该类存在并在该包中编译(即,target/classes/com/spp/config/main/SqlGeneratorHarness.class)。

我懂了...

我尝试过类似的变体

mvn exec:exec -Dexec.executable="java" [...]

mvn org.codehaus.mojo:exec-maven-plugin:1.2.1:java [...]

无济于事。是什么赋予了?

我在 Windows 7 Enterprise 64 位上运行 Maven 2.2.1、Java JDK 1.6.0_27。

我的 pom.xml 中用于 exec-maven-plugin 的片段是......

版本在哪里设置<properties>

0 投票
1 回答
109 浏览

windows - Maven如何在其他一些命令失败的情况下执行另一个命令

在这里,我在 Maven 中遇到了类似的问题

我无法想象在另一个命令失败的情况下如何运行命令。

谢谢你的帮助

0 投票
3 回答
3014 浏览

maven - 如何在 exec-maven-plugin 中设置 file.encoding 属性?

我试图通过 exec-maven-plugin 执行我的独立应用程序,但它以 WIN 编码开始,而不是 UTF-8。我阅读了有关 Java 命令行键 -Dfile.encoding=UTF-8 的信息。如何将此属性设置为我的应用程序?谢谢。

maven pom:

0 投票
1 回答
20216 浏览

maven - How can I set a environment variables in Maven per run?

In my project, we've created a Maven module to get the specific JBoss AS and unpacked.
Then all the test cases can be run under this Jboss AS as embedded container.
We're using jboss-ejb3-embedded-standalone to call the embedded container, however, it just find the JBOSS_HOME from environment variables and use that one to run. Thus we have to update the JBOSS_HOME per mvn install.

I tried to do this in maven by introduce exec-maven-plugin as below:

In the output of console, I can see

....

But when launching JBOSS, it's still running the one with origin JBOSS_HOME set.

Besides, I've tried using maven-antrun-plugin too.

It turns out the same.

Am I wrong on the configuration or there're some better way?

0 投票
2 回答
3827 浏览

maven - “exec-maven-plugin”不执行

我有以下我正在成功执行的配置文件(“mvn exec:exec -DrunMule”):

在同一 pom.xml 中执行 Maven 构建时,我试图将其转换为在特定阶段运行:

当我执行“mvn clean install”时,这个新插件不会执行。我不清楚为什么它不会。

- - - - - - - 更新 - - - - - - -

曾经的建议是将配置放入执行中。这是我尝试过的,但仍然没有执行。

0 投票
1 回答
2683 浏览

jquery - 使用 maven 处理 jQuery + jQuery UI 资源

这是我当前的文件夹结构:

如您所见,jssrc/main/webapp/resources. 我正在使用 scm 插件来查看这些 GitHub 存储库:

https://github.com/jquery/jquery

https://github.com/jquery/jquery-ui

结帐后,我需要使用他们的构建机制来连接和缩小并移动target/jquery/dist/jquery.min.js, target/jquery-ui/build/dist/jquery-ui.min.js,jquery-ui/build/dist/jquery-ui-1.9pre/ui/minified/i18n/jquery-ui-i18n.min.jstarget/myproject-1.0-SNAPSHOT/resources/js.

这是我的 pom.xml 的必要片段:

我只需要以下步骤:

  • 用于exec-maven-plugin使用jquery的concatenating+minifying机制(Makefile)
  • 用于maven-antrun-plugin使用jquery-ui的concatenating+minifying机制(Ant build.xml)
  • 将缩小的 jquery、jquery-ui 和 jquery-ui-i18n js 文件移动到target/myproject-1.0-SNAPSHOT/resources/js
  • 然后执行其他生命周期阶段

但它停止在第 2 步:maven-antrun-plugin. 更具体地说,这里运行外部 shell 脚本的问题:

该脚本查找错误的目录(/home/danny/myproject/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js而不是/home/danny/myproject/target/jquery-ui/build/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js

编辑:问题是:minify-js.sh 得到错误的第二个参数($2)。将此添加到 modify-js.sh:echo "test: $1 -> $2"会导致:test: /home/danny/myproject/target/jquery-ui/build/dist/jquery-ui-1.9pre/ui/jquery-ui.js -> /home/danny/myproject/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js但是为什么呢?

EDIT2我向 jquery-ui 提出了一个请求来解决这个问题

但现在我需要知道如何将缩小的 jquery、jquery-ui 和 jquery-ui-i18n js 文件移动到target/myproject-1.0-SNAPSHOT/resources/jsafter war:excluded.

这里最好的方法是什么?

0 投票
4 回答
9469 浏览

maven - exec-maven-plugin 生成的进程会阻塞 maven 进程

我正在尝试使用 maven 执行以下场景:

  1. pre-integration-phase :使用主类启动基于 java 的应用程序(使用 exec-maven-plugin)
  2. integration-phase :运行集成测试用例(使用 maven-failsafe-plugin)
  3. post-integration-phase:优雅地停止应用程序(使用 exec-maven-plugin)

这是 pom.xml 片段:

如果我执行 mvn post-integration-test,我的应用程序将作为 maven 进程的子进程启动,但应用程序进程阻止 maven 进程执行下一阶段的集成测试。后来我发现maven exec插件中有一个bug(或者缺少功能?),因为应用程序进程阻塞了maven进程。为了解决这个问题,我将 MyApp.java 的调用封装在一个 shell 脚本中,然后附加“/dev/null 2>&1 &”以生成一个单独的后台进程。这是来自 runTest.sh 的片段(这只是一个片段,而不是实际的片段):

虽然这解决了我的问题,但还有其他方法吗?我错过了 exec-maven-plugin 的任何论点吗?

0 投票
3 回答
13288 浏览

java - exec-maven-plugin exec:java 失败:无法将配置值分配给 java.lang.String 类型的数组

执行mvn exec:java时无法正确解析配置参数,抛出以下错误:

[错误] 无法在项目 autotest-programmes 上执行目标 org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli):无法解析 mojo org.codehaus.mojo:exec-maven 的配置-plugin:1.2.1:java:无法将配置值分配给 java.lang.String 类型的数组:[-classpath,Classpath {},--glue,com.company.test.cucumber,--format,pretty,- -format, html:C:\workspace\autotest\target] -> [帮助 1]

这是使用的插件配置(使用 Apache Maven 3.0.3):