ANT manual

zhaozj2021-02-12  176

Access the following URLs can get almost all information.

http://ant.apache.org/

An example build.xml

a ant test.

ECHO Task - Simply output a given message.

Copy file

Mobile file

Compressed ZIP and TAR files

Tar is the same as

unzip

It is also possible to include OverWrite properties to control overlay behavior. The default setting is to override all existing files that match the entry in the archive file being extracted. Related task names are Untar, Unjar, Gunzip and Bunzip2

Replace the tag in the file

Replace task, it performs findings and replacements in the file. The Token property specifies the string to look up, the Value property specifies a new string, and all instances that look up the tag string are replaced with this new string.

The replacement will be performed in an appropriate location within the file itself. To provide a more detailed output, you can set the Summary property to true. This will result in the number of missing string instances that the task output is found and replaced.

Cvs

The main attributes of the CVS task are CVSROOT, which is a complete reference to the CVS knowledge base, including connection methods and user details. The format of this parameter is as follows:

[: Method:] [[user] [: password] @] Hostname [: [port]] / path / to / repository

Package is the name of Respository, that is, the name of the project.

Of course, first need to set the path to the CVS command, change the path in the environment variable.

Email

Need mail.jar and activation.jar

Note Be sure to set an encoding property

Custom task

ClassName = "FilesORTER

ClassPath = "." />

CVS usage: (to be recorded)

First Login

CVS -D: PServer: cvsroot@192.9.150.11: / cvsroot login

Then Checkout

CVS: PSERVER: CVSROOT@192.9.150.11: / cvsroot Checkout CMBC

Creating executable JARsCreating an executable JAR is easy. You begin by placing all your application code in a single directory. Let's say the main class in your application is com.mycompany.myapp.Sample. You want to create a JAR file that contains the application Code and Identifies The Main Class. To do this, create a file called manifest Somewhere (Not in Your Application Directory), Andd The Following Line to It: Main-Class: com.mycompany.myapp.sample

THEN, CREATE THE JAR FILE LIKE THIS:

JAR CMF Manifest Executablejar.jar Application-Dir

That's all there is to it - now the jar file executablejar.jar can be el executed using java -jar.

An executable JAR must reference all the other dependent JARs it requires through the Class-Path header of the manifest file. The environment variable CLASSPATH and any class path specified on the command line is ignored by the JVM if the -jar option is used.

Launching Executable Jarsnow That We've packaged our application Into An Executable Jar Called Executablejar.jar, We can Launch The Application Directly from The File Using The Following Command:

Java -jar Executablejar.jar

转载请注明原文地址:https://www.9cbs.com/read-6903.html

New Post(0)