煩惱歲月

          付出總是有回報(bào)的 take action follow your heart , or follow your head
          posts - 40, comments - 5, trackbacks - 0, articles - 4

          use maven to package and upgrade your application.

          Posted on 2009-06-07 14:25 不需要解釋 閱讀(283) 評(píng)論(0)  編輯  收藏 所屬分類: antmaven

          Mave is good at jar management. so maven can help me to package the java application. with maven help, we can make the release application zip smaller.

          for the smaller:we use the maven ant task to manager jars:

          build.xml

          <project basedir="." default="all" name="jars" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
          <property name="build.compiler" value="modern"/>
               <path id="maven-ant-tasks.classpath" path="${basedir}/maven/maven-ant-tasks-2.0.10.jar" />
            <typeset resource="org/apache/maven/artifact/ant/antlib.xml"
                     uri="antlib:org.apache.maven.artifact.ant"
                     classpathref="maven-ant-tasks.classpath" />

              <target name="all">
                    <antcall target="get_server_jars"/>
                    <antcall target="get_orchis_jars"/>
              </target>

              <target name="get_server_jars">
                  <artifact:dependencies pathId="dependency.classpath"  filesetId="maven.fileset">
                  <dependency groupId="junit" artifactId="junit" version="3.8.2"/>  
                  <dependency groupId="activation" artifactId="activation" version="1.1"/>    
                  <dependency groupId="castor" artifactId="castor" version="1.1"/>    

                  </artifact:dependencies>

              <copy todir="${basedir}/lib">
                  <fileset refid="maven.fileset" />
                  <!-- This mapped strips off all leading directory information -->
                  <mapper type="flatten" />
              </copy>
          </target>

              <target name="get_orchis_jars">
                  <artifact:dependencies pathId="dependency.classpath"  filesetId="maven.fileset">
                      <dependency groupId="junit" artifactId="junit" version="3.8.2"/>       
                      <dependency groupId="javax.servlet" artifactId="servlet-api" version="2.4"/>      
                  </artifact:dependencies>

              <copy todir="${basedir}/webapps/ROOT/WEB-INF/lib">
                  <fileset refid="maven.fileset" />
                  <!-- This mapper strips off all leading directory information -->
                  <mapper type="flatten" />
              </copy>
          </target>

          so we can use maven to update you application.


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          我實(shí)話告訴你們,我可是身經(jīng)百戰(zhàn)了.bbs我見的多了,哪個(gè)版我沒灌過?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風(fēng)聲.你 們有一好就是無論在哪個(gè)版,什么話題都灌,但是灌來灌去的問題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說灌水啊,關(guān)鍵是要提高自己的知識(shí)水平.你 們啊,不要總想著弄個(gè)大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?
          主站蜘蛛池模板: 伊春市| 潍坊市| 鄯善县| 扬州市| 太原市| 贵州省| 鄂伦春自治旗| 维西| 宜黄县| 登封市| 且末县| 三江| 明星| 莎车县| 玉溪市| 桂平市| 柳州市| 美姑县| 明光市| 光山县| 陈巴尔虎旗| 密山市| 克拉玛依市| 榆社县| 沧源| 防城港市| 盱眙县| 富顺县| 台安县| 广汉市| 天祝| 安福县| 盐边县| 叶城县| 呼伦贝尔市| 安乡县| 靖边县| 临泽县| 遵化市| 汾西县| 安平县|