Using Maven as build tool for Lua programs - maven-2

I need a build tool for compiling,testing, reporting and the deployment of Lua programs.
I chose Maven 2 because of our Polarion version supports it.
Unfortunately, I couldn't find any Maven plugins/archetypes for Lua.
As I am a newbie in Maven I want to know whether it is difficult to write a customized Lua plugin for Maven.

You can hook up the maven-compiler-plugin with any plexus compiler (reference here).
So I guess the standard way would be to write a plexus wrapper for the lua compiler using the Plexus Compiler API

Related

kotlin-test vs kotlin-test-junit

I have a kotlin project that is compiled to java.
My test library is junit.
Im using maven as my dependency management and Intellij IDEA.
recently I got that strange warning in my pom.
Inspection info: If you have kotlin-test and junit dependency then
most likely you better to include kotlin-test-junit instead of just
kotlin-test
What is the difference between kotlin-test and kotlin-test-junit?
from what I read it seems that kotlin-test is not deprecated, so Why did intellij recommend kotlin-test-junit instead of kotlin-test?
So I found the answer here (I don't understand how I missed it in my first search)
In short kotlin-test library provides a set of annotations and utility functions independently of the test framework.
Where kotlin-test-junit library provides an implementation on top of Junit Asserter and the annotations and utility functions kotlin-test provides.

Pros and Cons with installing Kotlin standalone compiler instead of using IntelliJ Kotlin plugin?

i understand that i can use Kotlin Plugin comes with IntelliJ but i can also install Kotlin standalone compiler. Is there any pros/cons using standalone vs IntelliJ own integrated?
I'd say that:
Any real Kotlin project (including projects in IntelliJ) should use a build system such as Gradle or Maven.
Enabling Kotlin support in a Gradle/Maven project will automatically download the correct compiler (and switch it when you update the Kotlin version in the config file) and not care about whether you have a stand-alone version installed.
Any other Kotlin tool will likely be integrated with them as well.
So the standalone compiler is pretty much only useful when you want to try something quickly outside any project, but then https://play.kotlinlang.org/ or https://try.kotlinlang.org/ can work as well; and again let you switch between Kotlin versions simpler than a manually installed compiler.
Running Kotlin scripts may be the only case where I would use the stand-alone compiler.
Not much, but having own install have few advantages, but probably not needed by most people on their machines:
You don't need intellij, so you can use that compiler in other IDE or just for other applications
You can use different version of compiler than the one from plugin.
But in most cases integrated one is all you need.

Use Sonar with Objective-C language definition

I've found a blog post that describes how to use CPD on an Objective-C project. The author also provided a CPD language library for ObjectiveC. Unfortunately, the GUI provided by the Violations plugin in Jenkins is rather ugly. The visualization that Sonar uses is much more helpful in analyzing the code.
The following command is used to generate the corresponding CPD output:
java
-Xmx512m
-classpath pmd-4.2.5.jar:ObjCLanguage-0.0.6-SNAPSHOT.jar
net.sourceforge.pmd.cpd.CPD
--minimum-tokens 100
--files [Path to XCode project classes]
--language ObjectiveC
--encoding UTF-8
--format net.sourceforge.pmd.cpd.XMLRenderer > cpd-output.xml
As far as I know, the project language can be configured in the Sonar plugin configuration at Jenkins. But how can I tell Sonar to use the ObjCLanguage library? I only need this for detecting code duplication and visualization by Sonar (since it is so much prettier).
If you want to have analysis results in Sonar, you need to install a Sonar plugin that brings support for the language. However, there's currently no plugin for Objective-C, so you won't be table to get what you're trying to achieve... unless you develop this plugin! ;-)
There seems to be ongoing work on an Objective-C plugin for Sonar. You may find it at https://github.com/fhelg/sonar-objective-c
I have also seen another Objective-C plugin for Sonar:
https://github.com/octo-technology/sonar-objective-c

Is there a good Rhino Javascript compiler available as Maven plug-in?

Commons JCI project doesn't seem to be maintained since a long time. Are there other options?
Maven does allow you to use Ant tasks using the AntRun plugin. So you could use the Mozilla compiler through an Ant task, such as this one. Not pretty, but I bet it will work.

Maven2 life cycle help

I’ve built a custom Maven2 plug-in using Ant. I would like to call another maven plug-in in particular the Cargo Maven2 plug-in immediately after the custom Ant plug-in successfully completes. However, I do not want to attach the Cargo plug-in to another goal or phase. Is there a way to have them run consecutively without having to write a batch script? Is there away to have the Custom Ant plug-in call out to the Cargo plug-in?
See this discussion: Re: calling plugin in another plugin? According to the Maven developers, this is not the way plugins are supposed to work.
However, there is this interesting comment:
Plugins/Mojos should be thin wrappers around a library. You'd want to use the library directly.
Cargo is not only a Maven plugin, it also has a Java API and an Ant task. So you could probably:
call the Cargo Ant task from your Ant mojo (I think you'll just need the Cargo JARs in your plugin's classpath);
rewrite your Ant mojo in Java, and invoke the Cargo API (you'd want to look at the sources of the Cargo plugin).
The Ant script that the maven-ant-plugin executes is not really aware of Maven as such; this plugin is designed for backwards compatibility with custom Ant tasks. I cannot think of a clean way of doing what you want though there may be some kind of hack that allows you to do it.
It should also be possible to execute a second instance of Maven from inside Ant, which runs purely the Cargo goal, but in that case you might encounter problems with locked files and the like. The way to do it would be to just use an tag in your Ant script and call the "mvn" executable with the appropriate goals as arguments.
The cleanest way is to simply bind the Cargo goal to a phase of the build, and have that run after Ant is finished. I do not see any disadvantage to that approach - you haven't really stated any specific reasons why you want to avoid it.
You might be interested in the two following maven
The Mojo Executor plugin and
The GMaven plugin
The GMaven plugin lets you write maven plugins using groovy. This gives you full access to ant using the Ant Builder, it is a very easy way to write ant scripts in Groovy.
Then in this Groovy mojo you could call any maven mojo using the Mojo Executor.
I have used those in several custom maven plugin and I haven't found an easier way to write and combine mojos.