Convert .docx resource to pdf during maven build automatically - docx4j

We have a maven project that contains a number of .docx files that need to be released as .pdf. Currently, we generate .pdf from a source .docx file manually, but this is error-prone; already we have had a release that went out with a stale version of a .pdf because a developer failed to convert to .pdf after modifying the source .docx file. To prevent similar snafu in future, I would like to perform .docx to .pdf conversion automatically during the maven build. I have looked at various converters and like docx4j the best; the problem is that I can't find a way to automatically invoke it during a maven build of our project.
I am considering writing a maven plugin that can be invoked during the compile (or package) phase to automatically perform this docx-to-pdf conversion, but am hoping that someone here can point to an existing solution to this issue.

Related

Where are the JarFiles and how can I add them into Selnium?

Downloaded latest extentreport jarfiles zip folder and extracted them. I see only two folder as displayed in the imageClick here and sub-folders contain lots of class file
I want to add the latest jarfiles to my project. Although, I could make use of Maven Project but wanted to do it manually by adding those downloaded jarfiles. Unfortunately, I could not find any jar files. There are java class files, properties file,pom file etc..but no jar files. Am I missing something or there is some way extract jars or add the META-INF folder to the project
While running the project i'm getting this error below. As I understood, its a runtime error since the class files are not available but its available during compiling
java.lang.NoClassDefFoundError: freemarker/template/TemplateModelException
Please suggest

How can I manually create a sources jar file to deploy to Nexus or use in Intellij?

I have here an outdated source code built with ant. But it's stil used as a library though.
For reference reason I want to able to have a look in the sources.
How can I manually create a sources jar file so that it's recognized by Intellij and Nexus as source to an already existing library?
So I can browse the referenced libraries sources for debugging reason for example.
Package the source code in a zip (in the same directory structure usually used in sources jars), and upload it in Nexus through artifact upload, giving it the classifier "sources". This should to the trick.

Is it possible to configure file types mapping in Idea via gradle 'idea' plugin

A little intro:
I work on a project with legacy codebase witch uses internal xml based descriptors with specific file extensions (about may be 10 extensions).
Let it be *.desc, *.check etc.
To have code highlighting for such a files I can configure Idea to consider these types of files as XML.
It's available through:
Preferences / Editor / File types
And then add all custom extensions to 'Recognized file types': 'XML'
Our project uses gradle as build tool
and my question is:
Is it possible to make same configuration via dsl of gadle 'idea' plugin?
The short answer is: No.
One could create a custom Gradle task that will modify IDE file type preferences XML file in the config directory. While it's possible to run such task automatically on the project refresh in IntelliJ IDEA, it will most likely not work since you can't modify IDE configuration when IDE is running (the changes will be reverted). So, you will have to run it from the command line, outside of IntelliJ IDEA when IDE is not running.
It's probably not what you want, but if documented, can be used by the team as the manual step to make this configuration change easier.
Using gradle idea is not recommended anyway.
A better way might be to provide your own IDE plug-in that will associate these file extensions with XML file type and instruct the team to install this plug-in.

how to register for files of specific type in intellij plugin

I want to write an intellij plugin that needs to have a file viewer of certain type/s.
say I have a bunch of .abc files in my project at various locations. I need my plugin to show a tree view of all those .abc files keeping their hierarchy intact.
what is the api I should look at ?
Plugin repository can discover file types supported by a plugin and later IDE gets information about file types supported by different plugins. When you open a file of the file type supported by some plugin you get a notification in the IDE.
Registering a File Type

Add Jpa Metamodel generated files using Gradle idea plugin to Intellij Idea sources

I'm using the idea plugin on a Gradle multiproject configuration to generate the Intellij configuration files. At the moment the build is working fine in Gradle, but it gives me errors on the IDE due to the missing JPA Metamodel source files.
My question is, how can I place the generated .java files in a different folder and set them as a source folder for the modules in Intellij?
Currently I'm trying to send the parameter -s to javac but I keep getting the error invalid flag: -s...
Depending on how you want the generated source files to be compiled, the solution may be as simple as adding the source files to the main source set:
sourceSets.main.java.srcDir "build/generated-files" // adapt as necessary
Additionally, compileJava will need to depend on the task that generates the sources.