如何配置 Xcode 以使用 Maven
XCode 开箱即用,支持 Ant(您可以生成多个示例项目)。
如何配置 XCode 使用 maven pom.xml 文件?
我试图设置的项目的前参考在这里:
它使用嵌套文件夹,每个文件夹都有自己的 pom.xml,所有这些都由通常的 Maven 构建目标控制:
- mvn clean install
- mvn install -o
- mvn install -o -DskipTests
嵌套模块是一个挑战;每个都安装到本地 ~/.m2/repository 中。
为了进行比较: eclipse 构建系统引用 ~/.m2/repository 中的 jar 来获取外部依赖项,同时仍然允许项目中的模块相互引用。
我想要一种为 XCode 设置类似的方法。
XCode comes out of the box with support for Ant (with several sample projects you can generate).
How can I configure XCode to use maven pom.xml files?
Fore reference the project I am trying to set up is here:
It makes use of nested folders, each with their own pom.xml, all controlled with the usual maven build targets of:
- mvn clean install
- mvn install -o
- mvn install -o -DskipTests
What makes this a challenge is the nested modules; each of which installs into the local ~/.m2/repository.
For comparison: The eclipse build system references jars in the ~/.m2/repository for external dependencies, while still allowing modules in the project to refer to each other.
I would like a way to set up something similar for XCode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Xcode Maven 插件 在您的Xcode。
这是 git hub 存储库。
为了使用 Xcode Maven 插件,必须满足以下先决条件:
You could use Xcode Maven Plugin to use maven in your Xcode.
this is the git hub repository.
The following prerequisites have to be fulfilled in order to use the Xcode Maven plugin:
您可以使用 do this:
创建完整的 ant 构建,然后从 xcode 中使用它。每次更改 pom.xml 文件时,您都需要重新运行该任务。您可以添加一个 shell 任务来运行它,作为构建的第一步。
您还可以尝试将
$M2_HOME/bin/mvn
转换为构建中的 shell 任务。这可能有用,但如果没有大量的黑魔法,你将永远无法用它来调试问题。我会在后者之前先尝试一下。
You can use do this:
to create a full ant build and then use that from xcode. You'll need to re-run that task every time you change the pom. You can add a shell task to do run that as the first step in your build.
You could also try to turn the
$M2_HOME/bin/mvn
into a shell task in the build. That might work but you'll never be able to debug issues with it without lots of black magic.I would try the prior before the later.
我注意到这个问题没有答案。如果不可能,那么也许你可以让maven调用ant目标来构建xcode?
I noticed that there are no answers to this question posted. If it is not possible, then maybe you can just have maven call an ant target to build the xcode?