开发者

How do I configure Xcode to use Maven

开发者 https://www.devze.com 2023-02-28 14:19 出处:网络
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?

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:

  • http://docs.geotools.org/latest/developer/guide/building/maven/build.html

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 sim开发者_Go百科ilar for XCode.


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:

  • Mac OS X >= 10.7(Lion)+ The build has to run on a Mac computer.
  • JRE 6+ The Java runtime environment has to be installed on the computer.
  • Maven >= 3.0.2 Maven 3 has to be installed and configured correctly so that is has access to central repositories.
  • Xcode >= 4.4 Xcode 4.4 or higher has to be installed as the plugin performs
  • Xcode command line calls.


You can use do this:

mvn ant:ant 

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.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号