JadiraOrg / jadira

Jadira Framework
Apache License 2.0
74 stars 44 forks source link

Odd compilation issue leads to failure to call JavaMoney method #28

Closed wwadge closed 9 years ago

wwadge commented 9 years ago

This example snippet will throw a method not found exception in the fromNonNullValue method as it attempts to invoke MonetaryCurrencies.getCurrency(...).

However if I copy StringColumnCurrencyUnitMapper as it is and use my copy of the class instead it will work so I'm guessing there's something going on during the packaging. My environment: java 1.8.

import org.jadira.usertype.moneyandcurrency.moneta.columnmapper.StringColumnCurrencyUnitMapper;
import javax.money.MonetaryCurrencies;

public class FooBar {

    public static void main(String[] args)  {
        MonetaryCurrencies.getCurrency("USD"); // this works so class and method are in place

        // throws method not found exception
        new StringColumnCurrencyUnitMapper().fromNonNullValue("EUR"); 

    }

    }
wwadge commented 9 years ago

build.gradle:

apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.8
version = '1.0'

repositories {
    mavenCentral()
}

dependencies {
    compile "org.javamoney:moneta:0.9"
    compile "org.jadira.usertype:usertype.extended:3.2.0.GA"
}
chrisphe commented 9 years ago

HEAD is being updated shortly to 1.0-RC3. If the issue remains, please advise