How to Work with Maven Libraries in an IPR when Users Have Different Repository Locations
Hi.
I'm using IntelliJ 8.1.3, and learning to work with Maven2.
I've created a project, and have defined several dependencies, and everything works fine.
The problem is that the location of my maven repository is set to d:\maven_repository, so the libraries IPR points to this location:
<component name="libraryTable">
<library name="Maven: javax.jws:jsr181-api:1.0-MR1">
<CLASSES>
<root url="jar://d:/maven_repository/javax/jws/jsr181-api/1.0-MR1/jsr181-api-1.0-MR1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://d:/maven_repository/javax/jws/jsr181-api/1.0-MR1/jsr181-api-1.0-MR1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://d:/maven_repository/javax/jws/jsr181-api/1.0-MR1/jsr181-api-1.0-MR1-sources.jar!/" />
</SOURCES>
</library>
</component>
When another user tries to work with the IPR (that we share using source control), IntelliJ cannot find this library, since it points to d:\maven_repository. Running a maven build works, but when editing a java file in IntelliJ it doesn't recognize any of the classes in this library, and I can't use them.
How can this be solved? Can't the IPR point to the root of the repository using a variable instead of a hard-coded path?
Thanks,
Oz
Please sign in to leave a comment.
Try creating a Path Variable pointing to your repository (Settings->Path Variables).
It will be written into ipr files instead of the absolute path and you will be able to share your projects.