I have a project ‘P’ in directory ‘P’. I want the use a css file in ‘P’ but the css file is not in directory ‘P’. It is at one level above ‘P’. Could I still include/use the css file in ‘P’ without changing the directory structure or making a copy of the css file?
Yes, you can add directories outside of the root project directory:
Project Structure → Modules → Sources → Add content root
Then after adding a directory, you can see it under your project root.
Related
I created .clj script in the package com.lapots.game.journey.math. I saw notification that my clj file is not under source root.
At that time I did not know that I could make clojure folder as source root so I made my new package as source root.
However now I am unable to unbind math folder as source root and display it as package com.lapots.game.journey.math instead of just math. As result when I made an attempt to create clojure namespace with clojure kind
As a namespace in my clojure file inside math folder I've got just
(ns script)
instead of
(ns com.lapots.game.journey.math.script)
How to revert math folder from source root to a plain package?
Right click the directory in the project pane and select Mark directory as -> Unmark as sources root.
Simple answer:
Close IntelliJ
Delete the .idea directory & all contents
Re-start IntelliJ and select File -> New -> Project from existing sources
Navigate to your root directory and select project.clj and click OK.
I'm not sure about your namespace organization, but I assume you know it must match the directory hierarchy for both clojure and java.
Is it possible to rename the .idea folder that's automatically created by IntelliJ or move it to a different location?
Renaming the .idea directory is not possible; IntelliJ IDEA always reads project files from the directory with that exact name, and it can't be changed.
Moving is sort of possible. The locations and content roots of modules in IntelliJ IDEA are completely independent from the location of the project itself. Because of that, you can create a project in a directory that doesn't contain any code, and set up modules with content roots pointing to the directories where the code is located.
In Eclipse I am able to configure output folder for every directory in project. For example:
src/main/java -> app/target/classes
src/main/resources -> app/target/classes
src/main/custom_data -> app/custom_data
I cannot find out how to specify output directory for my 'custom_data' folder in IDEA. Is it possible?
You need to create a separate module which would have your custom_data directory as a source root or a resource root. Then you'll be able to specify the output directory for that module.
Recently set up a multi module project in IntelliJ with the following structure:
/module1
/module2
/web-module
/sql
/lib
/a few more folders
I set up module1+2 and web-module as modules in IntelliJ so those show up, but how do you make the sql and lib folder show up in the project panel? They should be included in VCS as well, but IntelliJ ignores them. How do you add folders outside modules to a project?
Screenshot of project and explorer view:
This is not a strict answer to the question, but it worked for me so I'm posting, perhaps someone will find this useful.
If you want to add an arbitrary folder to your project (even from some different location than your projects), just add it as a module. You needn't worry about the type so much e.g. I needed to add a folder with some SQL scripts, I added it as a Java module and it's nicely visible in IntelliJ even though it has no maven structure or Java sources.
This is how to do it:
File > Project Structure > Modules
Add > New Module > ... (e.g. Java Module)
In the new module settings mark the subfolders that you want to see as 'Sources'
Voilà! :)
This is something that I typically see when creating a project from existing modules. All the modules will show in the project but not the other project related directories. These directories might be, configuration files, environment scripts or bundles of SQL scripts that don't fit neatly into an Intellij module type.
To show the rest of the project source files and directories, I create a parent module from the project root.
File->Project Structure->Modules
Create a new module using the + sign. The new module could be any type (I use java).
On the Next screen set the Content root and Module file location to the Project's root folder.
Select Finish
All of your other modules should now be submodules of the root, and your other project files should now show up.
Add and remove content roots
To add a new content root:
Go to File | Project Structure, or press Ctrl+Shift+Alt+S.
Select Modules under the Project Settings section.
Select the necessary module, and then open the Sources tab in the right-hand part of the dialog.
Click Add Content Root.
Specify the folder that you want to add as a new content root, and click OK.
source: https://www.jetbrains.com/help/idea/creating-and-managing-modules.html
I used File -> New -> Module from Existing Sources...
Then I simply select the folder and add it.
In Project view mode all directories (except the ignored ones from the settings) should show up. Of course the base folder for your multi-project has to be the folder above module1.
EDIT:
Your project should look like this (project view tree):
MY_PROJECT_ROOT (~/the/folder/to/your/project)
|- /module1
|- /module2
|- /web-module
And in this case, you should definitely see the other folders. I got a sample project set up where this is working.
EDIT 2:
From your screenshot, I assume you are missing the root directory (the project root is not as you expected). I added another screenshot. There should be a single root folder for your 3 modules. This one is missing at your screenshot. You have 3 separate folders with no common root folder. On MacOs, the project root is displayed in the window title. In my case it points to ~/devel/sandbox.
I guess you should try to create a new project in for that trunk folder. From the scratch. Then add the existing modules and you should be fine?!
I would like to create a script to modify my debug configuration in intellij. The path of tomcat changes, and i have to manually go into the run config and edit things. I have tried to find the place where intellij stores these settings to no avail.
question: does anyone know where IJ stores its run configuration
The location would depend on 2 factors, whether the configuration is local to the user or shared with the other developers and if you are using the file based (legacy) or the directory based project format.
File based project, local configuration: .iws file
Directory based project, local configuration: workspace.xml file under .idea directory
File based project, shared configuration: .ipr file
Directory based project, shared configuration: .xml file under runConfigurations subdirectory of .idea directory or files inside .run directory in the project root (you can customize the location of the shared configurations in the latest versions).
Its here .idea\runConfigurations (correct for Idea 11). Just copy this folder to new project.
EDIT: As per comment, if runConfigurations folder doesn't exist, check the 'Share' box inside the Run/Debug configuration