Simple Maven Clarification Question

Hello Everyone,

I am a complete novice when it comes to using Maven to build Ignition modules. I did manage to stumble through making an Abstract Tag Driver in version 7.9 and now have come to the point of migrating it to version 8.0

I would like clarification on the package goal when building the project.
image
As you can see in the picture. There is a top folder file that contains the build and driver folders within them. Why is it that I have to run the package goal on the top-most folder and not the other two folders? In fact running it on the snmpModule-build folder resulted in a compile error.

FYI. I’m running Eclipse 4.12.0 and the OpenJava 11 JDK implementation. .

Thank you,
Brandon

Because that's the way the plugin (ignition-maven-plugin) was written to work, I guess.

Thank you Kevin. I will keep that in mind. Side note: In testing this module, it seems that driverContext.getHomeFolder() no longer returns the correct file path since the version 8.0 installation adds another folder called opcua in the filepath. Can you confirm this?

The “home” folder from DriverContext should be pointing at $IGNITION/data/opcua/devices/$deviceName on 8.0.

Now that you’ve mentioned it, it occurs to me this is not backwards compatible with 7.9 in that there is no migration of the data from the old location to the new location. Oops.

How do I access the “home” folder? There is no home variable that I can find in the DriverContext class.

Not sure what you’re asking. You already mentioned using driverContext.getHomeFolder(). That’s what’s available to you.

Oh. I’m sorry. I had not applied our license to the machine which prevented it from writing out the csv file and I didn’t realize it until just now. :man_facepalming:

Thank you Kevin!

Hey Kevin,

I’m in the process of porting my code over to the new ManagedDevice abstract class and it does not seem that the new DeviceContext has a way to get the home folder. Can you tell me what the new method is to get to this folderpath?

Thanks.

Looks like this wasn’t included on DeviceContext by accident.

You can derive it yourself with a GatewayContext. Call context.getSystemManager().getDataDir() to get the general Ignition data dir, then store it wherever you’d like in there or derive the same path to a device folder the OPC UA module would give you by going to $DATA/opcua/devices/$DEVICE_NAME.

In 8.1.2 DeviceContext should have a DeviceContext::getDeviceFolderPath method on it.

Thanks Kevin for the heads up.