Tuesday 19 June 2012

Using Apache-IVY : Missing dependency

This is just in case I loose this reference.
I had an error with my Ivy dependencies which reported "org.eclipse.persistence#org.eclipse.persistence.jpa;2.2.0: not found". It took me a while to find it but this post on Stack-Overflow helped.
It means that the standard Maven repositories do not hold this JAR so I have connected to the Eclipse Maven repository @ http://download.eclipse.org/rt/eclipselink/maven.repo/.

How?

Well my ivysettings.xml has this setting in it <ibiblio name="Eclipse-libraries"   m2compatible="true" root="http://download.eclipse.org/rt/eclipselink/maven.repo/" /> and looks like this:

<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.   
-->
<ivysettings>
    <properties file="${ivy.settings.dir}/ivysettings.properties"/>
   
    <settings defaultResolver="embedplaysafe" />
   
    <!-- Where the Cache is placed -->
    <!-- <caches defaultCacheDir="${ivy.settings.dir}/ivy-cache" /> -->
    <caches defaultCacheDir="${defaultCache.dir}" />
   
    <resolvers>
        <!-- Path is important as this is the final repository -->
        <chain name="embedplaysafe"
               returnFirst="true"> <!-- if a revision is found in the filesystem then ivyrep will not be queried -->
            <!--
            It is a filesystem resolver, so looks at a directory structure to retrieve the artifacts.
            This one is configured to look in the repository sub directory of the directory that contains the ivysettings.xml file
             -->
            <filesystem name="local">
                <artifact pattern="${repository.dir}/[type]/[artifact]-[revision].[ext]" />
                <ivy pattern="${repository.dir}/[type]/[module]-[revision].xml" />
            </filesystem>
            <!--  See http://www.buildmeister.com/articles/escape_from_jar_hell_with_apache_ivy_the_agile_dependency_manager -->
            <!-- 
            <url name="buildmeister"> 
               <ivy pattern="http://m2.buildmeister.com/[module]/[revision]/ 
                ivy-[revision].xml" /> 
               <artifact pattern="http://m2.buildmeister.com/[module]/[revision]/ 
                [artifact]-[revision].[ext]" /> 
            </url>
            -->
            <!--  See http://stackoverflow.com/questions/1033859/ivy-via-nexus-proxy  -->
            <!-- It looks in the ibiblio maven repository to retrieve the artifacts.  -->
            <!--   -->
            <ibiblio name="uk-libraries"         m2compatible="true" root="http://uk.maven.org/maven2" />
            <ibiblio name="global-libraries"     m2compatible="true" usepoms="true" />
            <ibiblio name="Eclipse-libraries"   m2compatible="true" root="http://download.eclipse.org/rt/eclipselink/maven.repo/" />
          
        </chain>
    </resolvers>

</ivysettings>


I hope this helps you.

Monday 18 June 2012

Java 7 classpath broken on Windows XP

Please file under "for F*cks sake!!!"

It seems that the ability to assign a wild card as a class path when setting up a Java comand-line script is broken for Java 1.7 and windows users (On XP certainly).

Previously you could type .... java -cp "somewhere/*"
WHICH would do the trick now you have to add a magic character to make it work.
SO the command becomes java -cp "somewhere/*;"

Just file under GRRRR!

Or see this handy post by someone far less annoyed than I am.
http://stackoverflow.com/questions/9195073/broken-wildcard-expansion-for-java7-commandline-on-windows7