VJET Java2Js with Maven? - java

Is it currently possible to execute the VJET Java2Js compiler from Maven or it's strongly bonded to the Eclipse IDE plugin?

No it's not strongly bonded to Eclipse plugin and yes it is possible to make this run with a build system such as maven.
It can be run with a java main or ant plugin. There is currently no support for a maven plugin today. We can make this work better by adding these to maven repo rather than just a p2 repo. Something I was planning on doing.
Here is the location of the ant plugin code http://git.eclipse.org/c/vjet/org.eclipse.vjet.core.git/tree/runtime/org.eclipse.vjet.rt.active.javatojs/src/org/eclipse/vjet/dsf/javatojs/prebuild/J2JsBuildTask.java
Here is the location of the java main:
http://git.eclipse.org/c/vjet/org.eclipse.vjet.core.git/tree/runtime/org.eclipse.vjet.rt.active.javatojs/src/org/eclipse/vjet/dsf/javatojs/cli/Java2Vjo.java

Related

Is it possible to package a portable maven in the project (and some general direction on how)?

The solution which needs bootstrapping is supplied as java code. Absolutely sure that this is necessary.
Receivers of the solution are guaranteed to have a suitable JDK
However, receivers of the solution are unable to install Maven (they don't know how to and cannot be taught)
My idea is to include some sort of Maven with the project, such that can be set up in a script like so:
set up maven repo as a folder under the solution folder (using relative reference)
set up anything else maven needs (don't know what, exactly)
call /path/to/maven/mvn compile -f /path/to/oneAndOnly/pom.xml
java /target/MySolutionClas
I am aware of: https://dzone.com/articles/embedding-maven but it gets confusing when he talks about configuring the portable maven into the pom.xml - wait, how is that pom.xml going to mean anything if maven is not configured yet?
(PS: I mean no disrespect to the author. I probably got it all wrong)
One could include a shell script that would setup maven if it is not already present.
The same for building and packaging encapsulating the complexities of the setup to just runing a couple of scripts.
Maven Wrapper aims to do just that, similar to the gradle wrapper seen in many gradle projects.
Running the wrapper goal of the maven wrapper plugin will generate a mvnw script in your project that can be run in place of a globally installed mvn command.
It's part of the maven 3.7.0 release, and documented more fully here: https://maven.apache.org/plugins/maven-wrapper-plugin/index.html
See https://github.com/takari/maven-wrapper for maven < 3.7.0

Installing a framework without maven or gradle

I try to install Javalin framework for creating an API on my Java project. (old java 8 project without maven, gradle, etc). I would like to install the framework with adding the jars to my build path.
But If I add the main jar file then it needs another dependencies jar , then another one another one another one.. etc.
Is there any simple way to add this to my project and all it's dependencies without any build tool like Maven,etc?
I have tried adding it manually , but each jar has many dependencies that it is almost impossible(?)
Well you could create a Maven project and use it to download the dependencies for you.
Maven dependency plugin might be useful. With it you could just call:
mvn dependency:copy-dependencies
and it will download all your dependencies into target/dependency.
I don't think there's a way, I'm afraid.  Dependency management is the exact problem that build tools like Maven and Gradle were created to solve!
The framework supplier could provide a ‘fat’ jar including all the dependencies; but I'm not aware of any that do, as everyone uses Maven or Gradle (or SBT or Ivy or Grape or Leiningen or Buildr).
I think the only real alternative is to do it manually — which, as you've discovered, can be a horrible and lengthy task if the dependency tree is big.  (And would need redoing with every update.)
So I'd suggest biting the bullet and using Maven if you can.

Can you have both maven's and gradle in same java build?

We already started our project in mavens(spring mvc) but realized gradle is better for managing big to enterprise level builds like our project. Is there a way to keep mavens but also add on gradle to the same build?
And if yes, how would I add gradle to my existing maven project? thanks.
I guess you need to make a decision:
Invoke maven from gradle
Invoke gradle from maven
If your end goal is to move to gradle then I suggest invoking maven from gradle. It looks like there's a plugin here which will do the job

Maven plugin which calls gradle

Is there a maven plugin available which calls gradle?
It might sound strange, but my company still uses maven and I want to make some experiments with gradle on our jenkins server. :-)

Can a Liferay V6.0.6 be written using Maven build system?

Liferay uses Ant SDK up to Version 6.0.6.
Since Version 6.1+ it now supports Maven.
I would like to know if I can build any plugin using Maven.
By the way, the maven support is only for V6.1+, what I am trying to infer here is a way to do it using Maven for V6.0.6 line.
So it seems there is not alternative. Thus I will have to resort to Ant when building plugins for Liferay prior to V6.1, and Ant/Maven afterwards, i.e., V6.1+ can be programmed using ant or maven build systems or Gradle (proviede there is such script upon this technology).
I, then, will use Maven.
Thanks for participatin in my searh in this topic.

Categories