January 5th, 2011 . by admin
When create file Ant build file build.xml in Eclipse , you get the message/warning:
No grammar constraints (DTD or XML schema) detected for the document.
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="default">
...
</project>
Solution:
Turn off validation for file build.xml
- Windows->References->Validation->XML Validator(click button …)
- -In Dialog Validation Filters for XML Validator
.choice Exlude Group
.click Button Add Rule..
- -On Dialog New Filter Rule Wizard
.choice Folder or file name
.click Button Next
.Input build.xml in field File or folder
.Click button Finish
.CLick button Ok in Dialog Validation Filters for XML Validator
.CLick button Ok in Dialog References
.Confirm Yes by Message The validation settings have changed. Afull rebuild is required..
Now the message No grammar constraints (DTD or XML schema detected for the document must now disappear
Posted in Java |
No Comments »
January 4th, 2011 . by admin
When i generate JavaDoc per Ant task
<target name="javadoc" depends="compile">
<mkdir dir="out/javadoc"/>
<javadoc packagenames="*"
sourcepath="src"
defaultexcludes="yes"
destdir="out/javadoc"
author="true"
version="true"
use="true"
windowtitle="SecurID" />
</target>
i get the error:
..
[javadoc] T:\eclipse_ws\sid\src\action\AbmeldenAction.java:3: package javax.servlet.http does not exist
[javadoc] import javax.servlet.http.HttpServletRequest;
[javadoc] ^
[javadoc] T:\eclipse_ws\sid\src\action\AbmeldenAction.java:4: package javax.servlet.http does not exist
[javadoc] import javax.servlet.http.HttpServletResponse;
[javadoc] ^
[javadoc] T:\eclipse_ws\sid\src\action\AbmeldenAction.java:6: package org.apache.struts.action does not exist
[javadoc] import org.apache.struts.action.Action;
[javadoc] ^
[javadoc] T:\eclipse_ws\sid\src\action\AbmeldenAction.java:7: package org.apache.struts.action does not exist
[javadoc] import org.apache.struts.action.ActionForm;
[javadoc] ^
..
Solution:
you must specify the classpath when run Javadoc
Define property myclasspath
<project name="sid" default="all" basedir=".">
<property file="build/version.properties" />
<property name="tomcat-home" value="T:\Tomcat 6.0" />
<path id="myclasspath">
<fileset dir="WebContent/WEB-INF/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${tomcat-home}/lib" includes="*.jar" />
</path>
Compiling task:
<target name="compile" depends="init">
<mkdir dir="out/tmp/classes"/>
<javac classpathref="myclasspath" srcdir="src" destdir="out/tmp/classes">
</javac>
</target>
Doc generating task:
<target name="javadoc" depends="compile">
<mkdir dir="out/javadoc"/>
<javadoc packagenames="*"
classpathref="myclasspath"
sourcepath="src"
defaultexcludes="yes"
destdir="out/javadoc"
author="true"
version="true"
use="true"
windowtitle="SecurID" />
</target>
Posted in Java |
1 Comment »