Is it necessary to have .java files in /src/main/java when compiling with maven? -
I tried to convert a project to Maven ... its /. / / / Main / Java, except when I install Maven, all those files (.hbm, .xml) are in my jar.
This is part of pom.xml:
<> pre & lt; Construction & gt; & Lt; Resources & gt; & Lt; Resources & gt; & Lt; Directory & gt; $ {Basedir} / src & lt; / Directory & gt; & Lt; Exclude & gt; & Lt; Out to & gt; ** / * Java & lt; / Exclude & gt; & Lt; / Not included & gt; & Lt; / Resources & gt; & Lt; / Resources & gt; & Lt; Plugins & gt; & Lt; Plugin & gt; & Lt; ArtifactId & gt; Maven-compliant plugin & lt; / ArtifactId> & Lt; Configuration & gt; & Lt; Source & gt; 1.5 & lt; / Source & gt; & Lt; Goal & gt; 1.5 & lt; / Target & gt; & Lt; Fork & gt; True & lt; / Fork & gt; & Lt; CompilerVersion & gt; 1.5 & lt; / CompilerVersion & gt; & Lt; CompilerArguments & gt; & Lt; Encoding & gt; UTF-8 & lt; / Encoding & gt; & Lt; / CompilerArguments & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt; & Lt; / Plugins & gt; & Lt; / Create & gt;
Using the above code, the class files are missing from my jar ... and no error message is displayed on the console, transfer them to the / src / main / java package Is the structure necessary?
Besides, what could be the reason for this behavior, some dependencies are missing?
I changed them, src / main / java and I got some exceptions to the console, but I'm still confused if I want to add them to the "src / main / java" structure ... < / P>
thanks
You can configure source directories similar to these resources :
& lt; Build & gt; & Lt; SourceDirectory & gt; $ {Basedir} / src & lt; / SourceDirectory & gt; & Lt; Resources & gt; & Lt; Resources & gt; & Lt; Directory & gt; $ {Basedir} / src & lt; / Directory & gt; & Lt; Exclude & gt; & Lt; Out to & gt; ** / * Java & lt; / Exclude & gt; & Lt; / Not included & gt; & Lt; / Resources & gt; & Lt; / Resources & gt; & Lt; / Create & gt;
Comments
Post a Comment