Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 39551 invoked from network); 22 Feb 2005 18:57:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Feb 2005 18:57:15 -0000 Received: (qmail 29178 invoked by uid 500); 22 Feb 2005 18:57:12 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 28283 invoked by uid 500); 22 Feb 2005 18:57:09 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 28269 invoked by uid 99); 22 Feb 2005 18:57:09 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from 67.108.219.62.ptr.us.xo.net (HELO exchangerelay.ezenia.com) (67.108.219.62) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 22 Feb 2005 10:57:08 -0800 Received: from us-exchange-1.ezenia.com (us-exchange-1 [172.20.1.163]) by exchangerelay.ezenia.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id FF9CQ7HS; Tue, 22 Feb 2005 13:56:09 -0500 Received: by us-exchange-1.ezenia.com with Internet Mail Service (5.5.2653.19) id ; Tue, 22 Feb 2005 13:57:06 -0500 Message-ID: From: Jeff Langr To: "'user@ant.apache.org'" Subject: custom taskdef requires Ant classloading of external JARs Date: Tue, 22 Feb 2005 13:57:00 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Greetings, I'm using Ant 1.6.1 under WinXP SP2. I wrote a custom task, deployToCache, that reads from a URL; the URL can sometimes be https. Here's the taskdef definition: The custom task requires jnet.jar, jsse.jar, and jcert.jar. The relevant code: System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); Access to the secure URL works fine when the code is run standalone, but when it's run as the Ant task, the provider isn't getting picked up. I'm aware that the custom task runs in Ant's Java process. If I change ant.bat and alter Ant's classpath in the batch file, things work fine: :runAntWithClasspath setlocal set SECUREJARS=c:\IWS251\CMBuild\ClassFiles\2512Classes "%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar;%SECUREJARS%\jsse.jar;%SECUREJARS%\jnet.jar ;%SECUREJARS%\jcert.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS% endlocal goto end If I put the three jars (jnet, jsse, jcert) in Ant's lib directory, it does not work. I tried also enhancing the portion of the taskdef and adding the JARs as pathelements: That didn't work. I looked at the Ant FAQ and didn't see anything that would help. The closest entry seemed to be "