How do I configure Xcode to use Maven
Asked Answered
V

3

8

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.

Vindictive answered 24/4, 2011 at 3:31 Comment(0)
K
2

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.
Keever answered 6/5, 2016 at 4:33 Comment(0)
G
1

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.

Groundspeed answered 21/11, 2011 at 15:45 Comment(0)
L
0

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?

Larrylars answered 19/11, 2011 at 7:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.