compilation - Confused about how Intellij compiles things and deals with resources -
i'm quite new intellij visual studio, , i'm quite confused how resource files work in intellij project. i'm read few questions & answers getting resources onto classpath, intellij docs, still confused. have few further questions:
- some questions mention maven, not. how maven projects differ normal modules in how compile things , deal resources?
- when run
mainmethod within intellij, run from? directly compiled.classfiles, or generatedjar? both exist in filesystem, , whats difference? - if put
.xmlfile somewhere in source tree, intellij default when compiling , running within intellij? how can change puts it? - what classpath when running
mainfunction within intellij? - how arbitary file included in jar file or alongside in compiled output?
in maven project ide follows maven rules process resources consistent results between command line maven build , idea build. if maven copies resources classpath, idea same.
from classpath of module , dependencies,
.classfile used.in non-maven project resources copied output according
settings|compiler|resource patterns. in maven project resources handled accordingpom.xmlresources rules. filesresourcesfolder copied automatically. other folders need added resources manually usingpom.xml.you can view classpath in command line printed in run console.
in maven project use
resourcesfolder. in non-maven project file should under source root , extension needs present inresource patternsconfiguration.
also note if using legacy compilation (external build disabled), idea use resource patterns configuration in maven projects , output between idea , maven different. same applies idea 11 , older versions.
Comments
Post a Comment