Is there a migration path to call maven plugin in bazel? - maven

I'm trying to convert a maven project to bazel projet. Everything works well by following the tutorials of bazel website. However, there is a project that use antlr4-maven-plugin to generate java code automatically. So I wonder if there is a feasible way to call maven plugin in bazel?

Related

can you build a maven project inside of a gradle wrapper

It may be just that I have a general misunderstanding how gradle build works, but it feels to me that I can not build a maven file inside of a gradle build. Since gradle uses the gradle.build file, and maven uses a pom.xml, it does not seem as though I can do this. I have multiple maven projects that I would like to wrap up with a gradle wrapper. I can not find ANYTHING on whether this is even possible.
Both Maven and Gradle are build tools and you should only use one of them for a given project.
If you have existing Maven projects and like the functionality provided by the Gradle wrapper, there is a similar wrapper for Maven (note that this is currently a third-party plugin but they plan to include it in the upcoming release 3.7 of Maven).
Alternatively you could convert your projects entirely to Gradle.

How to deploy custom JavaScript rules in Sonarqube?

I recently happened to work on Sonarqube version 5.3. I installed it and the Sonar server is running fine, I even analysed some code and installed some plugins, but now I want to define some custom rules in JavaScript. I downloaded the sample code from Sonarqube website for custom rule in JS.
The downloaded folder has one pom.xml and src folder. I don't know how to deploy this custom rule, somewhere I read that I need to create .jar file and place it in "extension/plugins" folder. I am stuck here: I don't know how to generate .jar file.
You've downloaded the source code, which is a Maven Project, now you should build the plugin with Maven (mvn).
See SonarQube documentation on Building Plugins.
When you download the "javascript custom rule" project from https://github.com/SonarSource/sonar-examples/tree/master/plugins/javascript-custom-rules
You can see that it's a Maven project as it has pom.xml
Now you have 2 option to create .jar out of this project.
Option#1: Open this project in Eclipse and do "Run==> maven Clean" and then "Run==> maven install"
It will generate a .jar for you which you can see in Eclipse console.
Option#2: Open Linux terminal or windows cmd, ensure that you have maven installed. Go to the project path where pom.xml is there and invoke command: "mvn clean install"
It will generate a .jar for you which you can see in console.
Thanks !

Maven to compile projects from source

I am very new to maven. Our project is using maven and i am wanting to know if there is a way to force maven to build using source ONLY? Using no repo and not downloading anything. I have all the source required to build the whole project.
I just want to compile clean with out downloading or using the local repo.
Thanks
Usually not. The main reason is that you don't have all the sources.
Maven is a tool to manage dependencies for you. So you can say: "I need JUnit 4.11" and Maven will download it for you and make sure it's on the classpath when it's needed.
Now, if your project depends on JUnit 4.11, you can't compile it from source without the sources for JUnit. And Hamcrest. And probably a dozen other things.
So, no, you can't. Maven will compile the sources of your project but it won't try to locate the sources of all dependencies and compile them as well. Maven was built with the assumption that the binaries uploaded to Maven Central are correct and that the binaries were built from the attached source files (which are incomplete, btw, so you can't always build the project correctly from them).

What should be in the build.gradle file to support imports of the standard groovy libraries

I had created a groovy project. It worked by itself.
After some additions I had to add a new jar of a new library into the imports.
While the whole workspace runs on Gradle, I added the appropriate Maven reference to the gradle.build file.
After running gradle cleanEclipse Eclipse the new library works OK.
But. All project references to the Groovy libraries disappeared. Foolish me, I had to put some references to them into the gradle.build, too.
The list of libraries:
groovy.util.slurpersupport
groovy.xml
org.codehaus.groovy.tools.xml
groovy.lang
But I don't know how to include them into gradle.build. I can't found them in maven repository. And even so, I have them installed in my Eclipse, and I should take these. And I can't google any help, because gradle groovy gives the results on how to call gradle from groovy, not vice versa.
Moving from plain Groovy to Gradle won't help, it is really about gradle support for calling a java library from groovy.
I have nothing against getting dependencies from Maven rep., but I don't know how to do it in my case - The problem is, that I have Eclipse 3.6. And I should use the last version of groovy for Eclipse 3.6. So, I have installed it from http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/. And I don't know what is the equivalent version in Maven - there is no info about it.
There was some error in the groovy in Eclipse installation. Now after running gradle cleanEclipse Eclipse while build.gradle has NO dependencies to groovy, almost everything runs OK, I only have to add the groovy nature to the project

Integrating JMeter as part of Maven project

I'm starting my work on the project related to creating some custom set of jmeter components that would be bundled in my custom jmeter distribution.
Those custom components are part of the Maven project and what I would like to do is try to integrate this maven project with latest jmeter project to be able to build and deliver jmeter build that contains my custom set of components with all related dependency jars.
Problem is that jmeter project is ant project.
I've came across this: http://maven.apache.org/guides/mini/guide-using-ant.html, maven-antrun-plugin which gives a possibility to embed ant task inside the maven pom.
Since I've never worked with ant (only worked with maven), my idea of using this plugin inside pom would be to define following targets:
download jmeter source from svn repository
build jmeter distribution
after building maven project (after install phase), copy jars (component and dependency jars) to the jmeter lib to form the final jmeter distribution with my custom components.
My question is: Do you find this approach as the right one (are there some things to consider while doing this) and if not, can you suggest me some other ways of achieving the same goal?
Thanks in advance
Since JMeter 2.6, Apache JMeter artifacts are published on maven2 repositories.
See:
http://mvnrepository.com/artifact/org.apache.jmeter/
See for an example :
https://github.com/Ronnie76er/jmeter-maven-plugin/wiki
So what you can do is have your maven project that references these artifacts as dependencies.
And if you want to generate a full bundle containing JMETER+You Plugins then use AntRunner to :
Unzip the official distribution
Copy your artifact in jmeter/lib/ext and dependencies in jmeter/lib
rezip it

Resources