How to build only java files with maven? -


i have project hierarchy below

 myproject--->pom.xml  myproject--->src--->main--->java---> java files under different sub directories  myproject--->src--->main--->resources---> non java files under different sub directories  myproject--->src--->main--->webapp---> non java files under different sub directories 

i want build project builds java files , include corresponding class files in final jar file

here relevant code pom.xml not find java files compile. not sure missing here?

<build>   <pluginmanagement>     <plugins>             <plugin>              <artifactid>maven-jar-plugin</artifactid>                <configuration>                  <verbose>true</verbose>                    <includes>                             <include>**/*.java</include>                             </includes>               </configuration>              </plugin>      </plugins> </pluginmanagement> </build> 

update:- info message no sources compile there java file in subdirectories

i assume want rid of files .xml, .xhtml, .properties etc? try add

 <resources/> 

or can disable executions, see here:

how speed maven builds 30 %: supressing unused plugin executions

suppress resource:default-resources , war:default-war executions.

actually you'll have to, because war plugin doesn't obey <resources>.

still, jar plugin add meta-inf dir. can deleted before package phase using clean plugin.

check this page further studies.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -