I am a newbie for maven and trying to convert an ant project to maven project. I am trying to acheive the same as in build.xml. I have build.xml that create 2 jar files and one war file which is bundled into one ear file. I have the tags in build.xml as below
<target name="indweb" depends="ejbjar, compileWeb">
<jar jarfile="${dist}/indweb.war" manifest="${webDir}/META-INF/MANIFEST.MF">
<fileset dir="${webDir}/" excludes="**/ind-help/** , **/ind-info/**">
<exclude name="${webDir}/WEB-INF/lib/ind_ejb.jar"/>
<exclude name="${webDir}/WEB-INF/lib/ind_utilities.jar"/>
</fileset>开发者_如何学JAVA;
</jar>
</target>
-----------------------
<target name="ejbjar" depends="ind_utilities">
<jar jarfile="${dist}/ind_ejb.jar" manifest="${ejbSourceDir}/META-INF/MANIFEST.MF">
<fileset dir="${ejbCompileDir}">
<include name="com/**/module/*.class"/>
<include name="com/**/packet/*.class"/>
<include name="com/**/mbean/*.class"/>
</fileset>
<metainf dir="${ejbSourceDir}/META-INF">
<include name="*.xml"/>
</metainf>
</jar>
</target>
---------
<target name="ind_utilities" depends="compileEjb">
<jar jarfile="${dist}/ind_utilities.jar">
<fileset dir="${ejbCompileDir}">
<include name="com/pkg/ind/lib/**/*.class"/>
<include name="com/pkg/ind/security/*.class"/>
<include name="com/pkg/ind/audit/*.class"/>
</fileset>
</jar>
</target>
----------------
<target name="compileEjb">
<echo message="Compiling ejb source codes in ${ejbSourceDir} ..."/>
<javac destdir="${ejbCompileDir}" srcdir="${ejbSourceDir}" classpathref="master-classpath" target="1.6"
debug="${Compiler.Debug}" failonerror="true" executable="${JAVA_HOME}/bin/javac"/>
</target>
---------------------
<target name="compileWeb">
<echo message="Compiling ind web source codes in ${webSourceDir} ..."/>
<javac destdir="${webDir}/WEB-INF/classes" srcdir="${webSourceDir}" classpathref="master-classpath" target="1.6"
debug="${Compiler.Debug}" failonerror="true" executable="${JAVA_HOME}/bin/javac"/>
</target>
Can anyone help me how to acheive this pom.xml.
You need to add dependencies to your pom for struts, beanutils, Java EE, and whatever else you're dependent on.
Some of these may depend on others - e.g., struts probably pulls in Java EE somehow. In these cases, you need to be careful about version conflicts if you explicitly also depend on Java EE and specify a different version.
Or... I'm assuming you know a lot less than you do, the dependencies are all there, and the problem is something else entirely!
精彩评论