Perforce Public Knowledge Base - Using Java 1.5 with P4Maven and P4Ant
Reset Search
 

 

Article

Using Java 1.5 with P4Maven and P4Ant

« Go Back

Information

 
Problem

Perforce Products based on P4Java require the use of Java version 1.6.  To use Java 1.5, the developer must write additional code to implement methods that are available in 1.6 but not 1.5.

Solution

P4Java allows developers to provide a helper class to perform the necessary OS functions that are missing in Java 1.5.

The first step is to write an implementation of the P4Java ISystemFileCommandsHelper interface.

See "Using P4Java with Java 1.5" for information about creating this Helper class.
 

 

 

Using your Helper Class in P4Maven

You must download and change our P4Maven code to use your ISystemFileCommandsHelper implementation class.

From our ftp site you can find p4maven-src.zip in the bin.java directory for your release.

For example, for release 2011.1 go to:

http://ftp.perforce.com/perforce/r11.1/bin.java/

 

Unzip and edit the class com.perforce.maven.scm.provider.p4.command.P4ServerExecutor to use your class instead of the (default) class it uses.  For example, change the setRpcFileSystemHelper call:

         ServerFactory.setRpcFileSystemHelper( new YourHelperClass() );

 


The source distribution contains instructions to rebuild P4Maven;  see BUILD.txt.
 

Using your Helper Class in P4Ant

You must download and change our P4Ant code to use your ISystemFileCommandsHelper implementation class.

From our ftp site you can find p4ant-src.zip in the bin.java directory for your release.

For example, for release 2010.1 go to:

http://ftp.perforce.com/perforce/r10.1/bin.java/

 

Unzip and edit the class com.perforce.p4java.ant.tasks.ServerTask and alter the initP4ServerOptions method to include a line to force usage of your class.  Example:

    /**
     * Initialize the Perforce server options, such as protocol-specific
     * properties and usage options.
     */
    protected void initP4ServerOptions() {
         ServerFactory.setRpcFileSystemHelper( new YourHelperClass() );
         .... 


The source distribution contains instructions to rebuild P4Ant;  see BUILD.txt.

 

 

 

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255