settings.gradle file did not showing in Intellij - gradle

I create a gradle project in IntelliJ, but settings.gradle file did not showing in intellij and when I want to create it this message shows:
A file with name 'settings.gradle' already exists
when I look at my project in explorer I found settings.gradle there, but it is not showed in the Project view in IntelliJ.

I found the solution. If you have my problem, you should go to
File -> Setting -> Editor -> File Types
and delete what you want in "ignore files and folders" section.

Related

How can I add multiple build paths for my jar file?

I want to have my jar file not only in my build/libs folder, but also somewhere else on my system. On maven, I just needed to copy and paste the entire section in my pom.xml and change the directory from there. Is there something similar in gradle?
This is how I am building my projects:
Open your Project Structure (right-click on your project directory in IntelliJ, and select open module settings) -> Artifacts -> Here you can change you're jar-output directory
...and also add new jar output directories
To change your out-directory path select Project Structure -> Modules -> Paths, and change output path

How to save a module from one computer and import into into another computer in IntelliJ with Maven

I have a Maven module in IntelliJ which works fine from one computer. I have saved the ".iml" file together with the project in Git. When I check it out on another computer,
"New Project"
then "File" -> "New Module from Existing Sources" -> Select the ".iml" file, the structure is all there, but no Maven dependencies are resolved.
How do I get IntelliJ to download and import the Maven dependencies?
Things I have tried:
"Re-build Project"
Right-click the module and "Re-build module"
"File" -> "Invalidate Caches / Restart" (both invalidate and restart)
"Re-import All Maven Projects", this simply deleted the two Maven modules from the project. I then had to re-create the modules as above, once they were there again I had the same problem.
On the comand-line "mvn" is able to import the project and resolve all dependencies just fine.
Additional information:
The ".iml" file, when I look at it in a text editor, does not have any absolute paths in it.
Here is a picture of the module settings window:
If your goal is to just import the project on another PC, don't rely on the iml files. Some even consider it bad practice to commit IDE specific files in maven projects, as not everyone on a project might use the same version or even a different IDE. If you take a look at popular .gitignore files (e.g. this one), you'll most often find that any IDE specific files get excluded.
Consider importing the projects pom.xml:
Import Project -> from external model -> Maven
EDIT
JetBrains recommends to NOT include the iml file with Maven or Gradle projects, see here

Maven - Wrong folder structure

I have checked in one of my projects to GIT repo. When i cloned it from GIT, imported the project to eclipse and converted the project to Maven Project, the folder structure of maven seems to be a bit different
This should have been src/main/java, src/test/java, src/test/respurces folder structures and com.vod... as package.
I have tried maven>update project, project>clean, maven>clean, eclipse::clean, eclipse::eclipse. But this project structure does not seem to go off.
Any possible solutions for this please?
After importing the project as eclipse general project, below is the structure.
This is a typical problem due to the lack of Eclipse metadata files in the GIT repository.
How to solve it:
Open the project's contextual menu > Java Build Path > Configure Build Path > Source. Drop off folder src and set as folder sources just these:
src\main\java
src\main\resources
src\test\java
src\test\resources
This will save some metadata to the .classpath file.
Also, you should ensure that this was set as a Maven project: Open the project's contextual menu > Configure. If there is the Convert to Maven command, execute it (if not, it is already a Maven project). This might save some metadata to the .project file.
Then, be sure to check in the Eclipse metadata files (.classpath, .project and .settings folder) to GIT. And, in order for this project can be safely shared to other developers, be sure not to enter absolute paths in the java build path, nor other system-dependant constraints.

Changing file type in Intellij IDEA for settings.xml

I'm working on python project in IDEA and have xml file named "settings.xml"
IDEA recognizes this file as maven configuration file and apply specific validation rules and my file marked by red error underlining
How can I mark this file as not maven file?
You can ingnore this file in maven plugin settings.
File -> Settings -> Maven -> Ignored Files

How to configure Maven project to not expect resources directory in Eclipse

I do not have any resources for my Maven project so I want to stop Maven expecting these directories and so remove these Java Build Path Problems in Eclipse,
Project 'XXX' is missing required source folder: 't-services/src/test/resources'
Project 'XXX' is missing required source folder: 'tlib/src/main/resources'
How do I configure pom.xml to achieve this?
A quite old thread, but I just faced the similar errors in Eclipse, after having deleted the src/main/java + resources and src/test/java + resources from Eclipse directly, as my project is only containing a pom file (packaging=pom).
To properly remove the errors, I just right-clicked on the project > Properties > Java Build Path > 'Source' tab, and there I removed the obsoletes entries. In the end, it modified the .classpath file of the project.
Janek, I saw similar with m2e <= 1.0 but it seems to be fixed with m2e 1.1.
I was able to clear up a similar problem. I removed the projects from Eclipse; deleted all of the .project, .classpath, and .settings files and directories from the file system; imported the project into Eclipse again. The problem went away.
you have to simply remove those folders from your project after that there shouldn't be any problem...But the message gives me the impression that those folders have been configured wrong...

Resources