spreadsheet-builder
spreadsheet-builder copied to clipboard
Not available in Maven Central
I cannot seem to find the 1.0RC2 release on Maven Central. I'm looking for it using the following coordinates org.modelcatalogue:spreadsheet-builder-poi:1.0.RC2
Am I missing something?
You are right, it looks like the item actually hasn't been ever synchronised to Maven Central.
please, follow the instructions "Set me up" here: https://bintray.com/metadata/model-catalogue
also take note that further development is going under new repository and coordinates: http://spreadsheet.dsl.builders/
@musketyr
Ok, I've updated my coordinates. And, I've attempted to use version 1.0. When I run the example provided in the documentation, I end up with an error
@Grab('builders.dsl:spreadsheet-builder-poi:1.0')
@Grab('org.apache.ivy:ivy:2.4.0')
//import org.modelcatalogue.spreadsheet.builder.poi.PoiSpreadsheetBuilder
import builders.dsl.spreadsheet.builder.poi.PoiSpreadsheetBuilder
File file = new File('spreadsheet.xlsx')
PoiSpreadsheetBuilder.create(file).build {
sheet('Sample') {
row {
cell 'A'
cell 'B'
cell 'C'
}
row {
cell 1
cell 2
cell 3
}
}
}
The error
Caught: groovy.lang.MissingMethodException: No signature of method: spreadsheetBuilderTest.sheet() is applicable for argument types: (java.lang.Integer, spreadsheetBuilderTest$_run_closure1$_closure2) values: [1, spreadsheetBuilderTest$_run_closure1$_closure2@5ddabb18]
Possible solutions: sleep(long, groovy.lang.Closure), sleep(long), wait(), grep(), every(), inspect()
groovy.lang.MissingMethodException: No signature of method: spreadsheetBuilderTest.sheet() is applicable for argument types: (java.lang.Integer, spreadsheetBuilderTest$_run_closure1$_closure2) values: [1, spreadsheetBuilderTest$_run_closure1$_closure2@5ddabb18]
Possible solutions: sleep(long, groovy.lang.Closure), sleep(long), wait(), grep(), every(), inspect()
at spreadsheetBuilderTest$_run_closure1.doCall(spreadsheetBuilderTest.groovy:10)
at com.sun.proxy.$Proxy9.configure(Unknown Source)
at builders.dsl.spreadsheet.api.Configurer$Runner.doConfigure(Configurer.java:28)
at builders.dsl.spreadsheet.builder.poi.PoiSpreadsheetBuilder.build(PoiSpreadsheetBuilder.java:48)
at spreadsheetBuilderTest.run(spreadsheetBuilderTest.groovy:9)
Am I missing another statement?
there are some weird behaviour going on when using Grab
. Please, try to use full Gradle project.
@musketyr
Per your suggestion, I created a gradle project and removed the @Grab annotations. However, when I try to execute the script I get
Caught: javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
at org.apache.poi.openxml4j.opc.internal.marshallers.PackagePropertiesMarshaller.<clinit>(PackagePropertiesMarshaller.java:41)
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:161)
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:72)
at org.apache.poi.openxml4j.opc.OPCPackage.create(OPCPackage.java:394)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.newPackage(XSSFWorkbook.java:475)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:243)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:235)
at builders.dsl.spreadsheet.builder.poi.PoiSpreadsheetBuilder.create(PoiSpreadsheetBuilder.java:18)
at builders.dsl.spreadsheet.builder.poi.PoiSpreadsheetBuilder$create.call(Unknown Source)
at spreadsheetBuilderTest.run(spreadsheetBuilderTest.groovy:4)
Is there any chance you can share the project? Which version of Java are you using? Which OS?
Sure.
I can share the project. The odd thing is that I was able to get it working using the Java example. Unfortunately, I could not get it to work using the Groovy example. I've created a repo on github where you can view the project: https://github.com/restagner/simple-spreadsheet-demo
I would appreciate it, if you could demonstrate, using the project I've submitted to you, how to get this working with pure Groovy.
see https://github.com/restagner/simple-spreadsheet-demo/pull/1
The latest release of the builders.dsl
fork is now at Maven Central.