[jboss-user] [Installation, Configuration & Deployment] - Building errors with script language
jzhuqlfeixia
do-not-reply at jboss.com
Mon Nov 13 02:05:40 EST 2006
Hello, bodies
I'm newly in ANT, as I can't find ANT's offical forums, I put my question here, hoping somebody could help me.
I use "script language" in my "compas-ant.xml", below is my codes:
| <target name="jar_iterator">
| <script language="beanshell">
| <![CDATA[
| String path=project.getProperty( "compasEARlocation" ) + "/jars";
| File jarsDir = new File( path );
| String[] jars = jarsDir.list(); //all the subdirs containing the expanded jars
| for( i=0; i < jars.length; i++ ){
| print( "Loading " + jars + "..." );
|
| // launches the manifest task that updates the original manifest with the compas-proxies.jar class-path entry
| manifestUpdater=project.createTask( "manifest" );
| manifestUpdater.setFile( new File(path + "/" + jars + "/META-INF/MANIFEST.MF") );
| org.apache.tools.ant.taskdefs.ManifestTask.Mode mode = new org.apache.tools.ant.taskdefs.ManifestTask.Mode();
| mode.setValue( "update" );
| manifestUpdater.setMode( mode );
| org.apache.tools.ant.taskdefs.Manifest.Attribute clsPath = new org.apache.tools.ant.taskdefs.Manifest.Attribute( "Class-Path", "compas-proxies.jar jboss_adaptor.jar" );//weblogic_adaptor.jar websphere_adaptor.jar
| manifestUpdater.addConfiguredAttribute( clsPath );
| manifestUpdater.execute();
|
| // creates the jar task and adds it to the repackJARs target
| jarer = project.createTask( "jar" );
| repackJARs.addTask( jarer );
| jarer.setDestFile( new File(path + "/" + jars + ".jar") );
| jarer.setBasedir( new File(path + "/" + jars) );
| jarer.setManifest( new File(path + "/" + jars + "/META-INF/MANIFEST.MF") );
| }
| ]]>
| </script>
|
| </target>
|
Here is error-messages after build:
| [java] BUILD FAILED
| [java] file:E:/compas/scripts/compas-ant.xml:163: Could not create task or
| type of type: script.
|
| [java] Ant could not find the task or a class this task relies upon.
|
| [java] This is common and has a number of causes; the usual
| [java] solutions are to read the manual pages then download and
| [java] install needed JAR files, or fix the build file:
| [java] - You have misspelt 'script'.
| [java] Fix: check your spelling.
| [java] - The task needs an external JAR file to execute
| [java] and this is not found at the right place in the classpath.
| [java] Fix: check the documentation for dependencies.
| [java] Fix: declare the task.
| [java] - The task is an Ant optional task and optional.jar is absent
| [java] Fix: look for optional.jar in ANT_HOME/lib, download if needed
| [java] - The task was not built into optional.jar as dependent
| [java] libraries were not found at build time.
| [java] Fix: look in the JAR to verify, then rebuild with the needed
| [java] libraries, or download a release version from apache.org
| [java] - The build file was written for a later version of Ant
| [java] Fix: upgrade to at least the latest release version of Ant
| [java] - The task is not an Ant core or optional task
| [java] and needs to be declared using <taskdef>.
|
| [java] Remember that for JAR files to be visible to Ant tasks implemented
| [java] in ANT_HOME/lib, the files must be in the same directory or on the
| [java] classpath
|
BTW, I have used ANT 1.5.4 / 1.6.5 / 1.7.0Beta3 instead, but none of them seemed sucess.
And "optional.jar", mentioned above, already add to my lib path.
Waiting for some suggestion, thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985316#3985316
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985316
More information about the jboss-user
mailing list