I have create a custom control in an existing module. In this I would like to use an CSV import method by using the openCSV package. All is well and build correctly, but when trying to run it in VASSAL by importing the class I get an exception the class could not be found (an class inside the imported package .jar file).
The package is automatically added to M2\repository folder, as all the other packages.
Is there an additional step to do before being known inside VASSAL? Or is the only way to import the classes of the inside the .jar file?
I have had this problem longer, when I try to use the mvn command I get the following exception:
DownloadFile with 2 arguments: An exception occured during a WebClient request.
Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain.
Any solutions for this?
What’s the exact command you’re running? What’s the complete output? (Use triple backticks to fence code and ouptut to make it readable in forum posts: ``` CODE HERE ```.)
MVN build worked.
I think I now have the same classes as I already had with a build inside my editor.
But I am still having problems with the linked library, since that is not anywhere linked to the codes. Any suggestions?
I am using the library/package called openCsv for loading in a csv file. This package is also saved by maven in my C:\Users\username.m2\repository\com folder. How do you make sure this is usable by VASSAL?
The maven-shade-plugin I mentioned above should unpack any dependent JARs you have and include them in the resulting module when you run mvnw package. (See lines 109-130.)
I don’t understand yet what you’re working around. The generated JAR file—the one built by mvnw package—is the module, and that’s used by Vassal directly.
Would you restate what it is you’re aiming to do? How is using the maven-shade-plugin not achieving that?
The file ‘C:\Users{user}\Downloads\OA_VASSAL\OA Demo Game\NameOfModule-0.0.1-SNAPSHOT.vmod’ is not a valid VASSAL module.
But I do see that the .jar file does not contain a buidlfile.xml and moduledata, could that be the reason?
Yes, that would cause you not to have a valid module.
Are those two files not in dist/? You have to put all of the non-class files you want to be in the module in dist/, as per the instructions for the module template.
I’ve added the maven-shade-plugin to the pom.xml disabled and with some comments, added a minimal buildFile.xml and moduledata to dist/ so that a module can be built without adding anything to the module template after checking it out, and updated the README: