Oxygen plugins - how to include dependent libraries as jars in the install goal, or build?
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 48
- Joined: Sat Jan 04, 2020 1:17 am
Oxygen plugins - how to include dependent libraries as jars in the install goal, or build?
Hello,
I am using the oxygen-sample-plugin-workspace-access project as a basis for a proof-of-concept. I want to include a jar as a dependency.
I’ve added the jar to the local repository, with the following command:
I can verify the jar, pom and other files are deployed here, in the local repository:
I added the artifact to the project pom file like this:
I’ve added some code to the project, referencing a class in the jar, and it compiles fine – so I know the project is finding the jar.
When I run the maven install goal, it builds successfully. But when I try to use the new code, I get this error:
I can find the project jar deployed to Oxygen here:
C:\<path>\oxygen\plugins\oxygen-sample-plugin-workspace-access-0.0.1\lib\oxygen-sample-plugin-workspace-access-0.0.1.jar
But, I can’t find the LinkFinder.jar file, which contains the class in the error. I need to include the jar as a dependency in the deployment for the code to work. How can I do that?
I was going to try using the <includes><include> tag under <configuration> in the pom.xml file, as documented here:
https://maven.apache.org/plugins/maven- ... clude.html
But, <include> does not appear to be an option in my project.
I was also looking at <includes> under <resources> in the pom.xml file, as covered here:
https://maven.apache.org/plugins/maven- ... clude.html
But jars don’t seem to be something you want to put in the \resources folder.
How do you include jar files as dependencies during the “install” goal in maven? Or, any standard way?
Thank you,
Will
I am using the oxygen-sample-plugin-workspace-access project as a basis for a proof-of-concept. I want to include a jar as a dependency.
I’ve added the jar to the local repository, with the following command:
Code: Select all
>mvn install:install-file -Dfile=C:\<path>\LinkFinder.jar -DgroupId=com.nom.id -DartifactId=linklookup -Dversion=1.0 -Dpackaging=jar
Code: Select all
C:\<path>\.m2\repository\com\nom\id\linklookup\1.0
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>myGroup</groupId>
<artifactId>oxygen-sample-plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>oxygen-sample-plugin-workspace-access</artifactId>
<dependencies>
<dependency>
<groupId>com.nom.id</groupId>
<artifactId>linklookup</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
When I run the maven install goal, it builds successfully. But when I try to use the new code, I get this error:
Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/nom/id/linklookup/LinkLookupQueryFrame
at myGroup.mySample.workspace.CustomWorkspaceAccessPluginExtension.insertLink(CustomWorkspaceAccessPluginExtension.java:373)
C:\<path>\oxygen\plugins\oxygen-sample-plugin-workspace-access-0.0.1\lib\oxygen-sample-plugin-workspace-access-0.0.1.jar
But, I can’t find the LinkFinder.jar file, which contains the class in the error. I need to include the jar as a dependency in the deployment for the code to work. How can I do that?
I was going to try using the <includes><include> tag under <configuration> in the pom.xml file, as documented here:
https://maven.apache.org/plugins/maven- ... clude.html
But, <include> does not appear to be an option in my project.
I was also looking at <includes> under <resources> in the pom.xml file, as covered here:
https://maven.apache.org/plugins/maven- ... clude.html
But jars don’t seem to be something you want to put in the \resources folder.
How do you include jar files as dependencies during the “install” goal in maven? Or, any standard way?
Thank you,
Will
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Oxygen plugins - how to include dependent libraries as jars in the install goal, or build?
Hi Will,
My advice for you is to start from this simple Maven Worskspace Access plugin project:
https://github.com/oxygenxml/sample-plu ... ce-access/
It has a readme which can help.
Clone/download it locally, use for example the Eclipse workbench to import the project as a Maven project in the workbench.
Then make changes to its "pom.xml". It uses an "assembly.xml" located next to it to copy all dependency JAR libraries inside the final created JAR library which will contain the entire set of plugin files (plugin.xml and both JAR libraries).
In the end if all goes well the plugin folder which you copy to the Oxygen "plugins" folder should look like this:.
Regards,
Radu
My advice for you is to start from this simple Maven Worskspace Access plugin project:
https://github.com/oxygenxml/sample-plu ... ce-access/
It has a readme which can help.
Clone/download it locally, use for example the Eclipse workbench to import the project as a Maven project in the workbench.
Then make changes to its "pom.xml". It uses an "assembly.xml" located next to it to copy all dependency JAR libraries inside the final created JAR library which will contain the entire set of plugin files (plugin.xml and both JAR libraries).
In the end if all goes well the plugin folder which you copy to the Oxygen "plugins" folder should look like this:
Code: Select all
C:\<path>\oxygen\plugins\oxygen-plugin-workspace-access-1.0\lib\oxygen-plugin-workspace-access-1.0.jar
C:\<path>\oxygen\plugins\oxygen-plugin-workspace-access-1.0\lib\LinkFinder.jar
C:\<path>\oxygen\plugins\oxygen-plugin-workspace-access-1.0\plugin.xml
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 48
- Joined: Sat Jan 04, 2020 1:17 am
Re: Oxygen plugins - how to include dependent libraries as jars in the install goal, or build?
Hi Radu,
Thank you very much for the suggestion. I will try it shortly.
I was able to find a workaround for the time being (manually copying the jars to the plugins folder), but will need the info you gave for the next version.
I appreciate the help!
Will
Thank you very much for the suggestion. I will try it shortly.
I was able to find a workaround for the time being (manually copying the jars to the plugins folder), but will need the info you gave for the next version.
I appreciate the help!
Will
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service