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
main
method within intellij, run from? directly compiled.class
files, or generatedjar
? both exist in filesystem, , whats difference? - if put
.xml
file somewhere in source tree, intellij default when compiling , running within intellij? how can change puts it? - what classpath when running
main
function 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,
.class
file used.in non-maven project resources copied output according
settings
|compiler
|resource patterns
. in maven project resources handled accordingpom.xml
resources rules. filesresources
folder 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
resources
folder. in non-maven project file should under source root , extension needs present inresource patterns
configuration.
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