Generating Maven pom.xml

The -genmaven option causes a Maven pom.xml configuration file to be generated.

It is necessary to add the asn1c runtime (asn1rt.jar) to some Maven repository. You can add asn1rt.jar to a local Maven repository using the following command:

mvn install:install-file -Dfile=../../../asn1rt.jar
   -DgroupId=com.objsys
   -DartifactId=asn1j.runtime
   -Dversion=7.3.0
   -Dpackaging=jar

The generated pom.xml will include a dependency with the groupId and artifactId shown above. The version will be based on the version number built into asn1c. You will need to ensure the version number you use to add the JAR to the repository is compatible with the version number specified in the pom.xml dependency.

You should follow Maven's standard directory layout. To do this, you'll likely want to run asn1c using options similar to the following:

-pkgpfx com.mycompany.abc
   -o src\main\java\com\mycompany\abc -dirs -genmaven

This ensures that package is rooted in the folder Maven expects and creates subfolders for each of the parts of the package name.

If you do not follow the standard directly layout, you should use the -objdir option to specify a separate folder for the location of your .class files. For example, you might use these options:

-pkgpfx com.mycompany.abc
   -o src\com\mycompany\abc -objdir bin -dirs -genmaven

If you generate a writer or reader sample program, the generated pom.xml file will include executions for the sample programs. They will be configured to run during the test phase. You can run the sample programs separately using the following commands:

         mvn exec:java@writer
         mvn exec:java@reader