Maven resource files, put java class files and property files in same directory

后端 未结 3 397
Happy的楠姐
Happy的楠姐 2021-01-12 15:56

I have java class files and property files in the same directory.

src/main/java/com/berlin/Test.class

src/main/java/com/berlin/Test.properties

With t

3条回答
  •  有刺的猬
    2021-01-12 16:46

    For the Maven reasons, you should place properties file into src/main/resources, not in src/main/java directory (keeping the same subfolder structure).

    That being said, to get what you want you need to replace (in your pom.xml) src with src/main/java. Not tested, but if you have problems please share.

提交回复
热议问题