I am new to IntelliJ IDEA, and I am using 12.1.4.
- Maven related
I tried to create a maven project, and then add two sub modules.
This is the project structure:
As you can see,the mavenapp
is the root project(parent project), while the app-common
and app-web
are the sub modules.
IntelliJ IDEA does the right thing by modify the pom.xml of mavenapp
:
<modules> <module>app-common</module> <module>app-web</module></modules><packaging>pom</packaging>
Now I have some problems:
1) make app-common
as a dependency of app-web
?
That's to say, I want to IntelliJ IDEA modify the pom.xml of app-web
:
<dependency> <groupId>${project.groupId}</groupId> <artifactId>app-common</artifactId> <version>${project.version}</version> </dependency>
But I can not find how to make it? I can not find theapp-common
module at theMaven Artifact Search
dialog box.
2) extract the repeated dependencies to the dependencyManagement
of the pom.xml of the parent
While I mean if the app-common
and app-webapp
have some same dependencies, for example, thejunit
dependency.
It would be better if we define the junt
in the dependencyManagement
of the pom.xml of mavenapp
, I wonder if the IDE can make it for us?
- Edition related
I used to use the Eclipse before, so I found something I can not make it in IDEA.
1) When I type a "stri", then press key "alt+."(I have changed the key map of "Main menu-Code-Completion-Basic to alt+."), I got nothing. While in eclispe I will get this:
2) How to display all the counstructor of a class as this:
3) the format(I use the Ctrl+Shift+F).
For this kind of codes:
In eclipse it will format the line as one line to this:
IDEA does not. I have to delete the "\n" manually.
I have googled for all of the above questions, but I got no answer(maybe by my wrong search keys).
I hope someone can help me .
Thanks.