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
Post a Comment