I want to use IntelliJ in the following manner. A Project (akin to Eclipse workspace) that contains multiple modules (akin to Eclipse Projects). As you can guess I am moving over to IntelliJ from a more recent Eclipse background.
I set up an empty project called MainProject which appears in the dir structure:
This correctly contains my ".idea" directory. I want this to stay out of source control and on the C drive.
I then added two Java modules, one for each component within the project that I will work on. These are in perforce and under a p4 client spec with a root
("V" is a network drive that the code has to live on but I do not want the IntelliJ project files to live there). The two modules have a content root
This all works ok. I have marked the content correctly in the module, src, test etc
Now for the issue. When I try to set up perforce the project root is:
but the client spec root is
so I get the following error when I test the connection
<pre>
Connection problems: </br>
Wrong client specification: </br>
Client roots: </br>
v:\dev </br>
Actual root: </br>
C:\IntelliJProjects\MainProject </br>
</pre>
When using Eclipse, Perforce has never been concerned with where the Eclipse workspace is so likewise I was not expecting IntelliJ to be concerned with where the project file is stored. I can see many cases where you would not want the project or indeed the module .iml files under perforce but the code certainly would be.
The only way around this would be to have the project file on the network drive under the client spec but as it is at the project level it could not rightly live under either:
so I would have a project under
which would break if I ever altered client specs
The only other way I have figured out is that I add
as a directory under "Version Control" where you can add in directories
Is this the only way or can anyone advise a better approach?
I know this is an old question, but i'm having the same problem now and i managed to solve it.
I have an IntelliJ project in a folder A, while my Perforce workspace is in folder B.
In my project i have both modules inside the project folder and inside the Perforce workspace, and i was having the "Wrong client specification" error as i mapped the whole project to Perforce.
All i had to do was to go to: IntelliJ project preferences -> Version Control click on the + and add map my entire Perforce workspace directory to Perforce as a VCS, as in the picture:
Your setting is correct. If you map whole "Project" to Perforce VCS, IDEA will consider everything in your project (including .idea) to be under Perforce, which is not what you want.
BTW it's strongly advised to keep project source on local disks, otherwise IDEA might have issues with file synchronization or just might function slower than it could be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With