Those who have used jwsdp know that it has a special jwsdp-2_0-ant-docs, which shows the importance of ant and jwsdp.
When using jbpm-BPEL, jwsdp in ant mode is also the best. The specific process of an example is as follows:
Let's look at examples/account/build. xml in the jbpm-bpel-1.1.Beta3
<? XML version = "1.0"?>
<Project name = "Account" default = "Redeploy">
<Import file = "../common/ws-build.xml"/>
</Project>
Go to the redeploy of the ws-build.xml under common:
<Target name = "Redeploy"
Depends = "generate-artifacts, deploy"
Description = "regenerate artifacts and deploy application"/>
1. Generate-artifacts
2. Deploy
The content of 1 is as follows:
<Target name = "generate-artifacts"
Depends = "detect-wsgenerator"
Description = "generate Java mapping artifacts">
<Mkdir dir = "$ {output. java. dir}"/>
<Antcall target = "setup-wstools"/>
<Antcall target = "setup-wscompile"/>
</Target>
1.1 detect-wsgenerator
1.2 setup-wstools
1.3 setup-wscompile
1.1 is as follows:
<Target name = "detect-wsgenerator">
<Available property = "wstools. Available"
Classname = "org. JBoss. ws. Tools. Ant. wstools"
Classpathref = "JBoss. Path"/>
<Condition Property = "wsgenerator. Available">
<Or>
<Isset property = "wstools. Available"/>
<Isset property = "jwsdp. Home"/>
</Or>
</Condition>
<Fail message = "no artifacts generator available"
Unless = "wsgenerator. Available"/>
</Target>
In this section, check whether the resource org. JBoss. ws. Tools. Ant. wstools exists. If so, wstools. Available
The value is true.
Then, determine whether wstools. Available has a value or jwsdp. Home has a value. If yes, wsgenerator. Available is true.
Finally, if wsgenerator. Available is set to false, the system will throw a fail message: "No artifacts generator available ".
1.2 is as follows:
<Target name = "setup-wstools" If = "wstools. Available" Unless = "jwsdp. Home">
<Taskdef name = "wstools"
Classname = "org. JBoss. ws. Tools. Ant. wstools"
Classpathref = "wstools. Path"/>
<Antcall target = "Call-wstools"/>
</Target>
First, define the task named wstools. The corresponding class is org. JBoss. ws. Tools. Ant. wstools;
Call the call-wstools task.
The call-wstools task is as follows:
<Target name = "Call-wstools">
<Wstools DEST = "$ {output. java. dir}" Config = "$ {resources. dir}/wstools. xml"/>
<Move file = "$ {output. java. dir}/jaxrpc-mapping.xml"
Todir = "$ {output. Web. dir}"/>
</Target>
1.2.1 wstools, two parameters are passed in
1.2.2 move operation.
1.3 The content of setup-wscompile is as follows:
<Target name = "setup-wscompile" If = "jwsdp. Home">
<Taskdef name = "wscompile"
Classname = "com. Sun. xml. rpc. Tools. Ant. wscompile"
Classpathref = "wscompile. Path"/>
<Mkdir dir = "$ {output. classes. dir}"/>
<Mkdir dir = "$ {output. Web. dir}"/>
<Antcall target = "Call-wscompile"/>
<Delete>
<Fileset dir = "$ {output. java. dir}" includes = "**/* _ impl. Java"/>
<Fileset dir = "$ {output. classes. dir}" includes = "**/* _ impl. Class"/>
</Delete>
</Target>
First, define the wscompile task. The corresponding class is com. Sun. xml. rpc. Tools. Ant. wscompile;
Mkdir then calls the wscompile task.
1.3.1 The wscompile task is as follows:
<Target name = "Call-wscompile">
<Wscompile fork = "on"
Verbose = "on"
Import = "on"
Keep = "on"
Features = "norpcstructures, WSI, strict"
Base = "$ {output. classes. dir }"
Sourcebase = "$ {output. java. dir }"
Mapping = "$ {output. Web. dir}/jaxrpc-mapping.xml"
Config = "$ {resources. dir}/wscompile. xml"
Classpathref = "wscompile. path"
Jvmargs = "-duser. dir =$ {project. dir}"/>
</Target>
1.3.2 is something in the delete directory.
The content of 2 is as follows:
<Target name = "deploy"
Depends = "pack-web"
Description = "deploy application to server">
<Copy todir = "$ {JBoss. server. Deploy. dir }"
File = "$ {output. dir}/$ {module. name}. War"/>
</Target>
2.1 pack-web content is as follows:
<Target name = "pack-web" depends = "compile">
<War warfile = "$ {output. dir}/$ {module. name}. War" webxml = "$ {web. dir}/Web. xml">
<Classes dir = "$ {output. classes. dir}"/>
<Webinf dir = "$ {web. dir}" excludes = "Web. xml"/>
<Webinf dir = "$ {output. Web. dir}"/>
</War>
</Target>
2.2 is the copy directory.
The above process is complete. The execution result is as follows;
Buildfile: D:/jbpm-bpel-1.1.Beta3/examples/account/build. xml
Detect-wsgenerator:
Generate-artifacts:
Setup-wstools:
Setup-wscompile:
[Mkdir] created dir: D:/jbpm-bpel-1.1.Beta3/examples/account/target/classes
[Mkdir] created dir: D:/jbpm-bpel-1.1.Beta3/examples/account/target/resources/Web
Call-wscompile:
[Wscompile] command line: wscompile D:/eos6/jdk1.5.0 _ 09/JRE/bin/java.exe-duser. dir = D:/jbpm-bpel-1.1.Beta3/examples/account-classpath D:/jwsdp/jaxrpc/lib/jaxrpc-api.jar; D:/jwsdp/jaxrpc/lib/jaxrpc-impl.jar; D: /jwsdp/jaxrpc/lib/jaxrpc-spi.jar; D:/eos6/jdk1.5.0 _ 09/lib/tools. jar; D:/jbpm-bpel-1.1.Beta3/examples/account/src/main/resources COM. sun. XML. RPC. tools. wscompile. main-d:/jbpm-bpel-1.1.Beta3/examples/account/target/classes-features: norpcstructures, WSI, strict-import-keep-mapping D: /jbpm-bpel-1.1.Beta3/examples/account/target/resources/web/jaxrpc-mapping.xml-s d:/jbpm-bpel-1.1.Beta3/examples/account/target/Java-verbose D: // jbpm-bpel-1.1.Beta3/examples/account/src/main/resources/wscompile. XML
[Wscompile] [serviceinterfacegenerator: creating service interface: org. jbpm. BPEL. Tutorial. Account. accountservice]
[Wscompile] [customclassgenerator: generating javaclass for: accountoperation]
[Delete] deleting 1 files from D:/jbpm-bpel-1.1.Beta3/examples/account/target/Java
[Delete] deleting 1 files from D:/jbpm-bpel-1.1.Beta3/examples/account/target/classes
Compile:
[Javac] compiling 2 source files to D:/jbpm-bpel-1.1.Beta3/examples/account/target/classes
[Copy] copying 1 file to D:/jbpm-bpel-1.1.Beta3/examples/account/target/classes
Pack-Web:
[War] building war: D:/jbpm-bpel-1.1.Beta3/examples/account/target/account. War
Deploy:
[Copy] copying 1 file to D:/eos6/app_server/jboss-4.0.5/Server/default/deploy
Redeploy:
Build successful
Total time: 9 seconds