作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经开始使用 Maven2,并且正在尝试将我的一个项目从 ant 移植到 Maven。我已经成功构建了ear文件,使用了jaxb和其他位,但是还有一件事我不知道如何处理。
我有 WAR 模块,带有 ExtJS 代码,并且我正在使用 JSBuilder 来很好地创建和打包代码。这是作为 ant 任务完成的,如下所示:
<target name="-pre-compile" description="Building Frontend Libraries">
<java jar="web/lib/dev/JSBuilder2.jar" failonerror="true" fork="true" >
<arg line="--projectFile web/lib/dev/frontend.jsb2 --homeDir web/lib"/>
</java>
</target>
我想知道执行此操作的“行家”方法是什么?有没有一种方法可以纯粹在 maven 中完成(查看了 maven:exec 插件,但有点令人困惑),或者我是否必须从 maven 调用 ant 才能实现此目的?
谢谢
最佳答案
exec-maven-plugin是正确的答案(尽管你想要 java 目标)。您需要将其绑定(bind)到生命周期阶段。看usage page举个例子。在你的情况下,你需要这样的东西:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>jsbuilder</id>
<goals>
<goal>java</goal>
</goals>
<phase>compile</phase>
<configuration>
<mainClass><!-- fill in from jar's META-INF/MANIFEST.MF --></mainClass>
<argument>--projectFile</argument>
<argument>web/lib/dev/frontend.jsb2</argument>
<argument>--homedir</argument>
<argument>web/lib</argument>
</configuration>
</execution>
</executions>
<configuration>
<includeProjectDependencies>false</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
<dependencies>
<!-- a bit nasty, would be better if jsbuilder2 available in a maven repo. -->
<dependency>
<groupId>com.extjs</groupId>
<artifactId>jsbuilder2</artifactId>
<version>2.0.0</version>
<scope>system</scope>
<systemPath>web/lib/dev/JSBuilder2.jar</systemPath>
</dependency>
</dependencies>
</plugin>
如果您是 JSBuilder2 的大用户,值得询问 Cencha 是否可以将其发布到 Maven 中央存储库。将他们指向OSS Repository Hosting .
关于java - 在 Maven2 Web 应用程序中使用 JSBuilder2.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3372130/
假设您已经使用一堆 View 、 Controller 、模型、存储、实用程序等构建(编码)了 MVC Sencha Touch 应用程序... “构建”应用程序以供生产使用的最佳方法是什么? 任务是
我是一名优秀的程序员,十分优秀!