Maven 1: Whats' the best way of creating portable IPR

Hello!

I have a lot of maven1 projects which I want to build inside Team City.

Test coverage/inspections are two features which looks very useful to me, but they are not supported with anything else then "ipr runner"

There is a possibility of generating ipr files from maven's project.xml (there is maven plugin for this).

It looks bit awkward but is the idea of running with ... ant script maven command to generate ipr files which will be later used by team city build("Run before build" option)
sane?

Are there any other options?

I tried to also to generate ipr files and commit them to our SCM system - but at least what's generated by maven is not really portable as maven repository is installed in different places on different machines. So other question: are the some guide lines for creating portable IPR files which can be shared between developers and are can be used on multiple platform?

mm

3 comments

Michal,

Test coverage/inspections are two features which looks very useful to me,
but they are not supported with anything else then "ipr runner"


TeamCity 3.0 has option to use Maven2 projects for running duplicate and inspections runners. But since you have Maven1, that does not seem an option.

It looks bit awkward but is the idea of running with ... ant script maven
command to generate ipr files which will be later used by team city
build("Run before build" option) sane?

>

Are there any other options?


Another approach can be having a special build configuration (based on Maven2 runner) to generate the IPR and share the generated IPR as artifact, then depending on it in your build (this will work unless your project structure changes between these dependent builds). And again, as you have Maven1 project I am not sure this will work.

So other question: are the some guide lines for creating portable IPR files which can
be shared between developers and are can be used on multiple platform?


Unless you can use IntelliJ IDEA to create the projects, you can pursue with some manual hacking on replacing absolute paths in .ipr/.iml files to make it like normal files, but this all depends on the .ipr file the Maven plugin generates and we do not know much about it.

Of course, another option is to use IntelliJ IDEA :)

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Another approach can be having a special build
configuration (based on Maven2 runner) to generate
the IPR and share the generated IPR as artifact, then
depending on it in your build (this will work unless
your project structure changes between these
dependent builds). And again, as you have Maven1
project I am not sure this will work.

>
It will work exactly the same for maven1 and maven2 (I will just need to run maven1 via command line runner)

So other question: are the some guide lines for

creating portable IPR files which can

be shared between developers and are can be used on

multiple platform?

Unless you can use IntelliJ IDEA to create the
projects, you can pursue with some manual hacking on
replacing absolute paths in .ipr/.iml files to make
it like normal files, but this all depends on the
.ipr file the Maven plugin generates and we do not
know much about it.

Of course, another option is to use IntelliJ IDEA :)


As we use maven repositories for storing jars paths to jars are defined using the following pattern: $/groupId/jars/somejar-version.jar As I use windows for running idea and build server runs on Linux the location of $ will be different.

So two questions:
1. Can we use variables in IPR files?
2. How can we provide host specific values of those variables (e.g. location of MAVEN_REPO)

michal

0

Michal,

As we use maven repositories for storing jars paths to jars are
defined using the following pattern:
$/groupId/jars/somejar-version.jar > > As I use windows for running idea and build server runs on Linux the > location of $ will be different.

So two questions:
1. Can we use variables in IPR files?
2. How can we provide host specific values of those variables (e.g. location of
MAVEN_REPO)


IDEA has "path variables" to handle alike configurations. Once the Ipr uses them, if the Ipr is opened in TeamCity web UI Ipr runner settings, the path variables will be provided as fields that you can define using TeamCity build configuration properties.

e.g. you can define the location in the buildAgent.properties file and reference it as a property in the build configuration.

The best way to get the format of Ipr and path variables usages in it is to get IDEA and play with these settings looking at the resulting ipr/iml files.

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.