lucky_start_izumi
lucky_start_izumi

Reputation: 2591

intellij cannot create class-file when creating test class with maven project

I created a maven project, and my hierarchy is :

MyPro:
  .ideas
  src
    -main
       -java
          -mypackage
             -MyClass.java
    -test
       -java
          -mypackage
            - (PLACEHOLDER)

When I try to create MyClassTest.java at PLACEHOLDER i.e. in test/java/mypackage, I got unable to parse template class, cannot create class-file. But if I create TestMyClass.java file, it works. I wonder why is that?

Upvotes: 2

Views: 4323

Answers (1)

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

Do you have MyClassTest.java or something similar listed under:

SettingsEditorFile TypesText files ?

If so, try removing that pattern and check if you can create the class.


I was able to reproduce this error in a standard maven project, after adding the following file type:

enter image description here

And then trying to create the MyClassTest.java:

enter image description here

And after removing the file type there were no problems creating the Test class.

Upvotes: 8

Related Questions