Export Runnable JAR file

Hi team,

I have a project which includes main/resources/com/opengamma/strata/config/library/

Within this folder I have a OvernightIborSwapConvention.ini that references a class in my main java folder that specifies the conventions of swaps not defined in Strata yet.

I am able to run my strata project in Eclipse IDE which references these new conventions.

However, when I export my project as a Runnable JAR File, it looks like the resources library isn’t being referenced. (I have checked the manifest and the resource folder is included in the JAR)

Is there a step I am missing in the export process? or is there a tag I need to include in the pom file in order to reference this resource folder for the export?

Thanks vm

command line error when executing JAR file
Caused by: com.opengamma.strata.collect.result.ParseFailureException: Error parsing curve definition CSV file ‘calibrations.csv’: OvernightIborSwapConvention name not found: AUD-AONIA-3M-BBSW-3M
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.parseSingle(RatesCalibrationCsvLoader.java:376)
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.lambda$parse0$2(RatesCalibrationCsvLoader.java:306) at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.parse0(RatesCalibrationCsvLoader.java:307)
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.parse(RatesCalibrationCsvLoader.java:266)
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.load(RatesCalibrationCsvLoader.java:220)
at com.opengamma.strata.loader.csv.RatesCalibrationCsvLoader.load(RatesCalibrationCsvLoader.java:200)
at com.aud.Engine.calculate(Engine.java:909)
at com.aud.Engine.main(Engine.java:203)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
… 2 more

OvernightIborSwapConvention.ini
[providers]
com.aud.AUDIRSConvention = constants

AUDIRSConvention .class
public static final OvernightIborSwapConvention AUD_AONIA_3M_BBSW_3M =
makeConvention(“AUD-AONIA-3M-BBSW-3M”, AUD_AONIA, IborIndices.AUD_BBSW_3M, ACT_365F, P3M, 0, 0, COMPOUNDED);
public static OvernightIborSwapConvention makeConvention(
String name,
OvernightIndex onIndex,
IborIndex iborIndex,
DayCount dayCount,
Frequency frequency,
int paymentLag,
int cutOffDays,
OvernightAccrualMethod accrual) {

HolidayCalendarId calendarOn = onIndex.getFixingCalendar();
DaysAdjustment paymentDateOffset = DaysAdjustment.ofBusinessDays(paymentLag, calendarOn);
return ImmutableOvernightIborSwapConvention.of(
    name,
    OvernightRateSwapLegConvention.builder()
        .index(onIndex)
        .accrualMethod(accrual)
        .accrualFrequency(frequency)
        .paymentFrequency(frequency)
        .paymentDateOffset(paymentDateOffset)
        .stubConvention(StubConvention.SMART_INITIAL)
        .rateCutOffDays(cutOffDays)
        .build(),            
    IborRateSwapLegConvention.of(iborIndex));

}

POM Plugins:
build
plugins
plugin
groupId org.apache.maven.plugins /groupId
artifactId>maven-compiler-plugin /artifactId
version 3.11.0 /version
/plugin
plugin
groupId org.apache.maven.plugins /groupId
artifactId maven-jar-plugin /artifactId
version 3.3.0 /version
configuration
archive
manifest
addClasspath true /addClasspath
mainClass com.aud.Engine /mainClass
/manifest
/archive
/configuration
/plugin
/plugins
/build

Manifest:
Manifest-Version: 1.0
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
Rsrc-Class-Path: ./ postgresql-42.6.0.jar checker-qual-3.31.0.jar strata
-basics-2.12.21.jar strata-calc-2.12.21.jar guava-31.1-jre.jar failurea
ccess-1.0.1.jar joda-beans-2.8.3.jar joda-convert-2.2.3.jar slf4j-api-1
.7.36.jar strata-collect-2.12.21.jar strata-data-2.12.21.jar strata-loa
der-2.12.21.jar strata-market-2.12.21.jar strata-math-2.12.21.jar commo
ns-math3-3.6.1.jar strata-measure-2.12.21.jar strata-pricer-2.12.21.jar
strata-product-2.12.21.jar strata-report-2.12.21.jar log4j-slf4j-impl-
2.20.0.jar log4j-api-2.20.0.jar log4j-core-2.20.0.jar
Rsrc-Main-Class: com.aud.Engine
Class-Path: .

Have you unzipped the jar file and checked that the file is present?

One thing to check for is whether you have two files in the same folder, as one would overwrite the other in that case.