maven and editing related questions about IDEA 12.

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

is the root project(parent project), while the
are the sub modules.
IntelliJ IDEA does the right thing by modify the pom.xml of

Now I have some problems:
1) make

as a dependency of

That's to say, I want to IntelliJ IDEA modify the pom.xml of


But I can not find how to make it? I can not find the

module at the
Maven Artifact Search
dialog box.

2) extract the repeated dependencies to the
of the pom.xml of the parent

While I mean if the
have some same dependencies, for example, the
It would be better if we define the
in the
of the pom.xml of
, 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 .


Comment actions Permalink


Will ask our maven guy to comment on maven questions.

Regarding editing support - completion is case-sensitive by default, i.e. you should type not 'stri' but 'Stri' in order to get 'String' at completion variants. However, you can make it case-insensitive at 'ide settings | editor | code completion | case sensitive completion'.

Displaying all appropriate constructors - there is no such functionality per se. I.e. you should choose a class name (constructor will be inserted to the code) and then list all overloaded methods. It's more convenient to complete class name using 'smart completion' instead of basic completion (main menu | code | completion | smart type). E.g. it will insert 'new String()' for your sample but offer various CharSequence implementations for code 'CharSequence s = new '. Then you should use 'parameter info' action to list all overloaded methods ('main menu | view | parameter info', mapped to Ctrl+P at the default keymap).

Formatting - please uncheck 'project settings | code style | java | wrapping and braces | keep when reformatting | line breaks' for getting desired result.


Comment actions Permalink

About maven related questions:
1.) Maven Artifact Search dialog finds dependencies in local repository and index of remote repository. May be it's a bug that Maven Artifact Search doesn't contain project modules. You have to add dependency manually.

2.) There is "Extract managed dependency" refactoring. Right click on <dependency> element, select Refactor -> Extract -> "Extract Managed dependency"

Comment actions Permalink


Thanks, I will have a try.


Please sign in to leave a comment.