Date: Fri, 16 Oct 2020 17:03:35 +0800
Subject: [PATCH] fix build script

---
 pom.xml           | 44 +++++++++++++++++++-----
 src/ant/build.xml | 85 +++++++++++++++++++----------------------------
 2 files changed, 70 insertions(+), 59 deletions(-)

diff --git a/pom.xml b/pom.xml
index b654a2a..91d0d2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,17 +1,12 @@
  <project>
   <modelVersion>4.0.0</modelVersion>
   
-  <parent>
-    <groupId>org.sonatype.oss</groupId>
-    <artifactId>oss-parent</artifactId>
-    <version>7</version>
-  </parent>
-  
+ 
   <groupId>com.jamonapi</groupId>
   <artifactId>jamon</artifactId>
   <packaging>jar</packaging>
   <name>JAMon (Java Application Monitor)</name>
-  <version>2.75</version>
+  <version>2.74</version>
   
   <description>The Java Application Monitor (JAMon) is a free, simple, high performance, thread safe, Java API that allows developers to easily monitor production applications.
   
@@ -42,4 +37,37 @@
     </developer>
   </developers>
 
-</project>
\ No newline at end of file
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+        <inherited>true</inherited>
+      </plugin>
+    </plugins>
+
+    <sourceDirectory>java</sourceDirectory>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-catalina</artifactId>
+      <version>7.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-servlet-api</artifactId>
+      <version>7.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-util</artifactId>
+      <version>9.0.3</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/ant/build.xml b/src/ant/build.xml
index d9861f6..8d5c7ae 100755
--- a/src/ant/build.xml
+++ b/src/ant/build.xml
@@ -4,25 +4,22 @@
  <!--  Properties   -->
  <!--  ===========================================================================   -->
   <property name="project" value="JAMonAPI"/>
-  <property name="jamonapi_version" value="2.75"/>
+  <property name="jamonapi_version" value="2.74"/>
   <property name="name" value="${project}"/>
   <property name="src" value="${basedir}/src"/>
   <property name="build" value="${basedir}/build"/>
-  <property name="dist" value="${basedir}\dist"/>
+  <property name="dist" value="${basedir}/dist"/>
   <property name="backup" value="${basedir}/backup/"/>
-  <property name="releasedir" value="${basedir}/release/"/>
+  <property name="release" value="${basedir}/release/"/>
   <property name="doc" value="${src}/doc/javadoc/"/>
-  <property name="lib" value="${basedir}/lib/"/>
+  <property name="lib" value="/usr/share/java"/>
   <property name="java" value="${src}/java/"/>
-  <property name="osmon" value="/jamon_osmon/osmon/"/>
+  <property name="osmon" value="${src}/osmon/"/>
   <property name="debug" value="true"/>
   <property name="deprication" value="false"/>
-  <property name="source" value="1.5"/>
-  <property name="vm" value="1.5"/>
+  <property name="source" value="1.6"/>
+  <property name="vm" value="1.6"/>
   <property name="dist.jar" value="${dist}/jamon-${jamonapi_version}.jar"/> 
-  <property name="sources.jar" value="${dist}/jamon-${jamonapi_version}-sources.jar"/> 
-  <property name="javadoc.jar" value="${dist}/jamon-${jamonapi_version}-javadoc.jar"/>
-  <property name="osmon.zip" value="${dist}/osmon-${jamonapi_version}.zip"/>	
   <property name="jamontomcat.jar" value="${dist}/jamontomcat-${jamonapi_version}.jar"/> 
   <property name="dist.zip" value="${dist}/JAMON_ALL"/>
   <property name="webxml" value="${src}/WAR/WEB-INF/web.xml"/>
@@ -37,9 +34,14 @@
   <path id="class.path">
 
     <fileset dir="${lib}">
-        <include name="*.zip"/>
-        <include name="*.jar"/>
-    	<exclude name="catalina_tomcat4.jar"/>
+        <include name="tomcat-el-api.jar"/>
+        <include name="tomcat-servlet-api.jar"/>
+        <include name="tomcat/*.jar"/>
+        <include name="jetty/jetty-server.jar"/>
+	<include name="jetty/jetty-io.jar"/>
+	<include name="jetty/jetty-util.jar"/>
+        <include name="interceptor.jar"/>
+        <include name="log4j12-1.2.17.jar"/>
     </fileset>
 
   </path>
@@ -86,42 +88,28 @@
 
   </target>
   
-	 <!--  ===========================================================================   -->
-	 <!--  TARGET [RELEASE]  generates final distribution zip for sourceforge release! -->
-	 <!--  ===========================================================================   -->
-	 <target depends="WAR, javadoc" name="release">
+ <!--  ===========================================================================   -->
+ <!--  TARGET [RELEASE]  generates final distribution zip for sourceforge release! -->
+ <!--  ===========================================================================   -->
+  <target depends="WAR, javadoc" name="release">
+   <!-- Exclude all .class and .java~ (netbeans backup files  -->
+   <zip destfile="${release}//jamonall-${jamonapi_version}.zip">
 
-	    <jar destfile="${sources.jar}" basedir="${java}">
-	    <include name="**/*.java"/>
-	    </jar>
-	 	
-	    <jar destfile="${javadoc.jar}" basedir="${doc}">
-	    </jar>
-	 	
-	     <zip destfile="${osmon.zip}" basedir="/jamon_osmon/osmon">
-	     </zip>
-	 	
+     <zipfileset dir="${dist}" prefix="binaries">
+       <include name="*.war"/>
+       <include name="*.jar"/>
+     </zipfileset>
+     <zipfileset dir="${java}" prefix="java"/>
+     <zipfileset dir="${doc}" prefix="javadocs"/>
+     <zipfileset dir="${osmon}" prefix="osmon"/>
+   </zip>
 
-	  <!-- Exclude all .class and .java~ (netbeans backup files  -->
-	  <zip destfile="${releasedir}//jamonall-${jamonapi_version}.zip">
-	    <fileset dir="${basedir}">
-	        <include name="pom.xml" />
-	    </fileset>
-
-	    <fileset dir="${dist}">
-	      <include name="*.war"/>
-	      <include name="*.jar"/>
-	      <include name="*.zip"/>	    	
-	    </fileset>
-	  	
-	 </zip>
-	 	
-	  </target>
+ </target>
   
  <!--  ===========================================================================   -->
 <!--  TARGET [CLEAN]   -->
  <!--  ===========================================================================   -->
-<target depends="prepare,backup" name="clean">
+<target depends="prepare" name="clean">
   <delete dir="${build}"/>
   <delete>
 		<fileset dir="${dist}">
@@ -147,15 +135,10 @@
     <exclude name="**/jamonapi/proxy/JAMonDataSource.java"/>
   </javac>
  	
-  <javac  classpathref="class.path.tomcat4" debug="${debug}" deprecation="${deprication}" destdir="${build}" srcdir="${java}"  target="${vm}" source="${vm}">
-    <include name="**/jamontomcat/JAMonTomcat4Valve.java"/>
-    <include name="**/jamontomcat/JAMonTomcat5Valve.java"/>
-  </javac>
- 	
-  <javac  classpathref="class.path" debug="${debug}" deprecation="${deprication}" destdir="${build}" srcdir="${java}"  target="1.5" source="1.5">
+  <javac  classpathref="class.path" debug="${debug}" deprecation="${deprication}" destdir="${build}" srcdir="${java}"  target="1.6" source="1.6">
     <include name="**/jamonapi/aop/JAMonEJBInterceptor.java"/>
     <include name="**/jamonapi/proxy/JAMonDataSource.java"/>
-</javac>
+ </javac>
  	
   </target>
 
@@ -164,7 +147,7 @@
  <!--  ===========================================================================   -->
 <target depends="" name="javadoc">
  <mkdir dir="${doc}"/>
- <javadoc classpathref="class.path" destdir="${doc}" packagenames="${package}" >
+ <javadoc classpathref="class.path" destdir="${doc}" packagenames="${package}" additionalparam="-Xdoclint:none" >
 
  <sourcepath>
   <pathelement location="${src}/java"/>
-- 
2.23.0

