0

I want to create jar file from below project structure

enter image description here

and I need config.xml file be in the same location with Config class in the created jar file. However my config.xml file is missing after building jar file. I've done some workaround and put config.xml file into resources folder and my jar structure became like this:

|-console.jar
  |-com
  |-META-INF
  |-config.xml

and I manually moved config.xml file to com/test/ folder. I believe there is some way to do it with maven. Any ideas are welcome.

Joshgun
  • 372
  • 3
  • 16
  • Can you explain why do you need config.xml to be in the same package as Config.java? It can probably be done but from my experience it will be very confusing for future maintainer if this is not well justified – Tan Kim Loong Dec 20 '18 at 05:45
  • I'm coding this as additional module for existing project and that project needs config.xml file with Config class in same folder (I've read it from project's documentation and don't have any idea about why they've implemented it in that way). And it's definitely not working without above condition – Joshgun Dec 20 '18 at 05:50
  • @Ubercool Yes I've tried that solution and seems it works. But still some issues are remaining. When I build project with maven clean plugin and jar plugin respectively config.xml file still not includes but when I use rebuild module with intellij and create jar file with maven jar plugin it works. – Joshgun Dec 20 '18 at 06:01
  • @Ubercool however it's okay for now I'll try on my own. Thanks – Joshgun Dec 20 '18 at 06:02

0 Answers0