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:

  1. some questions mention maven, not. how maven projects differ normal modules in how compile things , deal resources?
  2. when run main method within intellij, run from? directly compiled .class files, or generated jar? both exist in filesystem, , whats difference?
  3. if put .xml file somewhere in source tree, intellij default when compiling , running within intellij? how can change puts it?
  4. what classpath when running main function within intellij?
  5. how arbitary file included in jar file or alongside in compiled output?

  1. 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.

  2. from classpath of module , dependencies, .class file used.

  3. in non-maven project resources copied output according settings | compiler | resource patterns. in maven project resources handled according pom.xml resources rules. files resources folder copied automatically. other folders need added resources manually using pom.xml.

  4. you can view classpath in command line printed in run console.

  5. in maven project use resources folder. in non-maven project file should under source root , extension needs present in resource 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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -