Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure Xcode to use Maven

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 similar for XCode.

like image 608
Jody Garnett Avatar asked Apr 24 '11 03:04

Jody Garnett


1 Answers

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.

like image 73
sal Avatar answered Sep 28 '22 02:09

sal