On 7/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I think it would be better not relying on external dependencies for
launching.
Then you direcly start the jar.

You could do that in a two step process:
- Launcher
  -- Options: debug, verbose, warn, error, ?
  -- maybe also: realm, host, username, passwd
  -- pass the rest options to 2nd step
  1. Instantiates "raw" Ivy
  2. Uses that Ivy to load its own dependencies
  3. Start Main
- Main
  Do the normal stuff


The idea is interesting, but where should get Ivy dependencies? From maven
repository? In this case the launcher "requires" an internet access, which
is not always the case. Or we should use the settings provided by the user,
thus requiring him to add Ivy dependencies to his repository. But what if
the repository requires an Ivy dependency (commons-vfs, ...)?

Therefore I think we should stick with providing Ivy dependencies on the
classpath, but if we get rid of commons-cli (the only mandatory dependency
for command line usage), users could use it without any complex classpath
setting, at least for simple cases. And for complex cases, they could still
use the Ivy launcher to resolve Ivy dependencies and run another instance to
run the actual class :-)

Xavier

Jan


>-----Ursprüngliche Nachricht-----
>Von: Xavier Hanin [mailto:[EMAIL PROTECTED]
>Gesendet: Mittwoch, 4. Juli 2007 09:43
>An: [email protected]
>Betreff: Re: svn commit: r552892 - /incubator/ivy/core/trunk/build.xml
>
>On 7/4/07, [EMAIL PROTECTED]
><[EMAIL PROTECTED]> wrote:
>>
>> As Ivy has a command line interface ... would it be useful,
>if the jars
>> are startable?
>
>
>The problem is that Ivy for its command line usage has a dependency on
>commons-cli. Thus it requires settings the classpath, which is
>not handled
>properly by the JAR specification (relative paths, not a very
>good idea),
>and one of the reasons behind JSR-277.
>
>But I've already wondered if it wouldn't make sense to get rid of this
>dependency on commons-cli. I use the command line interface to
>use Ivy as a
>launcher, and having to get commons-cli (and its dependencies) in the
>classpath for this makes it less straightforward to use.
>
>WDYT?
>
>Xavier
>
>Jan
>>
>>
>>
>> Index: build.xml
>> ===================================================================
>> --- build.xml   (revision 553083)
>> +++ build.xml   (working copy)
>> @@ -255,6 +255,7 @@
>>                                 <attribute
>name="Extension-name" value="
>> org.apache.ivy" />
>>                                 <attribute
>name="Build-Version" value="${
>> build.version}" />
>>                                 <attribute
>name="Bundle-Version" value="${
>> bundle.version}" />
>> +                               <attribute name="Main-Class" value="
>> org.apache.ivy.Main"/>
>>                         </manifest>
>>                         <fileset dir="${core.classes.build.dir}" />
>>                         <fileset dir="${ant.classes.build.dir}" />
>> @@ -270,6 +271,7 @@
>>                                 <attribute
>name="Implementation-Version"
>> value="${build.version}" />
>>                                 <attribute
>name="Implementation-Vendor"
>> value="Apache Software Foundation" />
>>                                 <attribute
>name="Build-Version" value="${
>> build.version}" />
>> +                               <attribute name="Main-Class" value="
>> org.apache.ivy.Main"/>
>>                         </manifest>
>>                         <fileset dir="${core.classes.build.dir}" />
>>                         <fileset
>dir="${optional.classes.build.dir}" />
>>
>>
>>
>>
>>
>>
>> >-----Ursprüngliche Nachricht-----
>> >Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> >Gesendet: Dienstag, 3. Juli 2007 18:07
>> >An: [EMAIL PROTECTED]
>> >Betreff: svn commit: r552892 - /incubator/ivy/core/trunk/build.xml
>> >
>> >Author: xavier
>> >Date: Tue Jul  3 09:06:31 2007
>> >New Revision: 552892
>> >
>> >URL: http://svn.apache.org/viewvc?view=rev&rev=552892
>> >Log:
>> >review jar manifest and generate small doc about jars (with
>> >contribution from Tjeerd Verhagen)
>> >
>> >Modified:
>> >    incubator/ivy/core/trunk/build.xml
>> >
>> >Modified: incubator/ivy/core/trunk/build.xml
>> >URL:
>> >http://svn.apache.org/viewvc/incubator/ivy/core/trunk/build.xml
>> >?view=diff&rev=552892&r1=552891&r2=552892
>> >===============================================================
>> >===============
>> >--- incubator/ivy/core/trunk/build.xml (original)
>> >+++ incubator/ivy/core/trunk/build.xml Tue Jul  3 09:06:31 2007
>> >@@ -246,34 +246,43 @@
>> >                               manifest="${basedir}/MANIFEST.MF">
>> >                       <metainf dir="${basedir}"
>> >includes="LICENSE,DISCLAIMER,NOTICE" />
>> >                       <manifest>
>> >+                              <attribute
>> >name="Specification-Title" value="Apache Ivy with Ant tasks" />
>> >+                              <attribute
>> >name="Specification-Version" value="${build.version}" />
>> >+                              <attribute
>> >name="Specification-Vendor" value="Apache Software Foundation" />
>> >+                              <attribute
>> >name="Implementation-Title" value="org.apache.ivy" />
>> >+                              <attribute
>> >name="Implementation-Version" value="${build.version}" />
>> >+                              <attribute
>> >name="Implementation-Vendor" value="Apache Software Foundation" />
>> >+                              <attribute
>> >name="Extension-name" value="org.apache.ivy" />
>> >                               <attribute name="Build-Version"
>> >value="${build.version}" />
>> >                               <attribute
>> >name="Bundle-Version" value="${bundle.version}" />
>> >-                              <section name="org/apache/ivy">
>> >-                                      <attribute
>> >name="Extension-name" value="org.apache.ivy" />
>> >-                                      <attribute
>> >name="Specification-Title" value="Apache Ivy" />
>> >-                                      <attribute
>> >name="Specification-Version" value="${build.version}" />
>> >-                                      <attribute
>> >name="Specification-Vendor" value="Apache Software Foundation" />
>> >-                                      <attribute
>> >name="Implementation-Title" value="org.apache.tools.ant" />
>> >-                                      <attribute
>> >name="Implementation-Version" value="${build.version}" />
>> >-                                      <attribute
>> >name="Implementation-Vendor" value="Apache Software Foundation" />
>> >-                              </section>
>> >                       </manifest>
>> >-                              <fileset
>> >dir="${core.classes.build.dir}" />
>> >-                              <fileset
>> >dir="${ant.classes.build.dir}" />
>> >-                              <fileset
>> >dir="${optional.classes.build.dir}" />
>> >+                      <fileset dir="${core.classes.build.dir}" />
>> >+                      <fileset dir="${ant.classes.build.dir}" />
>> >+                      <fileset
>dir="${optional.classes.build.dir}" />
>> >               </jar>
>> >               <jar
>> >destfile="${artifacts.build.dir}/${final.core.name}">
>> >                       <metainf dir="${basedir}"
>> >includes="LICENSE,DISCLAIMER,NOTICE" />
>> >                       <manifest>
>> >+                              <attribute
>> >name="Specification-Title" value="Apache Ivy Core (without Ant
>> >tasks)" />
>> >+                              <attribute
>> >name="Specification-Version" value="${build.version}" />
>> >+                              <attribute
>> >name="Specification-Vendor" value="Apache Software Foundation" />
>> >+                              <attribute
>> >name="Implementation-Title" value="org.apache.ivy" />
>> >+                              <attribute
>> >name="Implementation-Version" value="${build.version}" />
>> >+                              <attribute
>> >name="Implementation-Vendor" value="Apache Software Foundation" />
>> >                               <attribute name="Build-Version"
>> >value="${build.version}" />
>> >                       </manifest>
>> >                       <fileset dir="${core.classes.build.dir}" />
>> >                       <fileset
>dir="${optional.classes.build.dir}" />
>> >               </jar>
>> >+              <echo
>> >file="${artifacts.build.dir}/readme.txt">The Ivy jars
>> >explained${line.separator}
>> >+${line.separator}
>> >+${final.name}    The full Ivy jar, including all Ivy
>> >classes.${line.separator}
>> >+${final.core.name}    The Ivy core, eg everything but classes
>> >dependent on Ant.${line.separator}
>> >+              </echo>
>> >+
>> >               <!-- clean generated module properties file -->
>> >               <delete
>> >file="${core.classes.build.dir}/module.properties" />
>> >       </target>
>> >-
>> >
>> >       <!--
>> >=================================================================
>> >            PUBLISH LOCAL
>> >
>> >
>> >
>>
>
>
>
>--
>Xavier Hanin - Independent Java Consultant
>http://xhab.blogspot.com/
>http://incubator.apache.org/ivy/
>http://www.xoocode.org/
>




--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/

Reply via email to