Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Schemas with SchemaGenTask Producing Ominous Warning

 
Jessie Kensinger
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone out there seen this warning and figured out how to resolve it? If so, could you please post how... Otherwise, I am posting this as informational in case anyone else out there might be curious.

warning: The apt tool and its associated API are planned to be removed in the next major JDK release. These features have been superseded by javac and the standardized annotation processing API, javax.annotation.processing and javax.lang.model. Users are recommended to migrate to the annotation processing features of javac; see the javac man page for more information.

Background:

I am building a project with Ant inside netbeans on a linux system. Inside my build.xml, I have the following:
<target name="-pre-compile">
<taskdef name="schemagen" classname="com.sun.tools.jxc.SchemaGenTask">
<classpath>
<fileset dir="/usr/local/netbeans-7.0.1/ide/modules/ext/jaxb" includes="*.jar" />
</classpath>
</taskdef>
<echo message= "Generating schemas..." />
<mkdir dir="${build.dir}/schemas" />
<schemagen destdir="${build.dir}/schemas">
<src path="${src.dir}" />
<schema file="Group.xsd" />
</schemagen>
</target>

What this target does is build an XML schema from a plain old java class (i.e. POJO). The XSD file gets created successfully, however the process appears to use code that has been depreciated and hence the warning being generated. The best evidence I could find for this is:
http://stackoverflow.com/questions/9148379/how-to-use-javac-to-replace-deprecated-wsgen-or-apt-in-jdk-7-or-6
As the article seems to imply, it is a warning I will simply have to suffer with until Java 8... however... I thought Id post here and see if someone has an idea on how I should make it go away.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic