Migrate Java eclipse project build with ant to Gradle - java

I have a legacy java project build with ant, and i need to migrate it to gradle using eclipse.
The thing is that I need to migrate all the project, not only convert the ant targets to gradle tasks.
My question is, where do i start? there's a list of steps to follow?

Have you tried it step by step according to this https://docs.gradle.org/current/userguide/migrating_from_ant.html instruction? There are a lot of examples and it looks pretty clear

Related

Apply Quarkus to non-maven, non-gradle Java projects

It's great to be able to use Quarkus on maven and gradle -based Java/JVM projects but what about projects that are built using other build systems like sbt or bazel or buck or anything else that's not a maven or gradle -based Java/JVM project.
I did hear about the command-line tool to do this, how far is the progress with this? Is there a way to get a sneak-peak!
For now, we don’t have plans to support other build tools. Supporting Gradle and Maven already has its fair share of challenges.
But contributions are always welcome.

Trying to compare migration from Ant build to Maven or Gradle for existing Java Project?

We have a complex Java Project with many processes/applications. Planning to move from Ant build to Maven or Gradle. Trying to compare the migration process to maven and gradle. Any thoughts and advice? Thanks,
Gradle is your choice. In the future if you want to migrate your app to android, it would be much easier since android studio uses gradle. Also gradle uses groovy, a powerful script language and you can add any java code in your build.gradle.
Disclaimer: This is my personal view, and I am not associated with gradle or maven.

How to execute maven plugins from gradle without having maven and java installed

I need to execute a maven plugin on a system that does not have both maven and java installed and installing both of them on the system is not an option. While searching for the ways, I found out that by using gradle we can build executable binaries that does not even require gradle to get executed, which perfectly fits my situation :) . Is there any way to execute maven plugins by using gradle. Thanks in advance
Java is required for Maven and for Gradle too.
You can use Maven Wrapper exactly like with Gradle.
Execute this command in project directory (this creates executable script like in gradle)
mvn -N io.takari:maven:wrapper
To invoke this project without maven installed use:
./mvnw GOAL
Gradle is a build system. You can build anything with it, including native binaries.
And yes, you can call Maven Plugins from Gradle, as Maven Plugins are written in Java and Gradle is based on Groovy and thus on Java.
But both facts have nothing to do with each other.
You can of course also use Gradle (or any other build system including manually stuffing things together) to build a distributable that includes a Java runtime environment. But then Java is, as said, shipped with your result. You cannot run Java code without having Java around, besides porting the Java code to something else like C++ that compiles to a native binary.
Yes, you can also call Java code from native code if you do some glueing, but no, also this will not work without having Java around, because that's the way Java works.
Both Maven and Gradle require java to be installed. See https://docs.gradle.org/current/userguide/installation.html

How to share code between Eclipse Swing/maven and Androidstudio / gradle project?

I am an experienced Java developer with years of familarity with Eclipse and Maven.
My goal is to create an android application and I am getting familiar with the latest Development environment Android Studio 2.3.2 which obviously uses Java 8 and Gradle. The app shall share code with an Eclipse based project that uses maven and Swing and is also Java 8 based. I am intending to publish the result as an open source project on github.
I found e.g.
https://github.com/uhafner/android-config as an example but that seems to be outdated.
https://github.com/cgeo/cgeo - which explictly states that eclipse is only used for codewriting/testing
Gradle project for plain Java and Android with single source tree suggests an answer for a gradle only approach that has a tutorial link as an answer (which is not accepted) and no example
https://github.com/javadev/calc which is purely maven driven and has two pom.xml files
https://github.com/adrian/upm-swing and https://github.com/adrian/upm-android simply have copied subdirectories instead of any kind of shared config management
How feasible is a combined maven/gradle project structure?
What would be a proper way to structure the project files to accomplish the above goals?
What are good examples projects that follow a similar approach?
My reason to be reluctant with Gradle and IntelliJ is obvious. It is an unfamiliar environment for me and android is not the main target of my development.
Part of the answer seems be covered at:
Can Android Studio be used to run standard Java projects?
I got somewhat of a success with the project https://github.com/BITPlan/can4eve
but would appreciate some help on the android studio / gradle side of things.
The project also has travis support built in and I am also running nightly Jenkins checks based on maven.

Is there a Java continuous testing plugin for Maven?

I'm looking for a plugin that would run in a console continuously to scan a Maven project's test sources directory, and when it detects a change kicks off a test cycle. Something analogous to mvn scala:cc or the Scala Build Tool, but for Java. Can anyone point me towards one?
I have personally used sbt even for a java only project just for continuous test feature.
I added a sbt build file to a maven based project and use sbt when developing, but use maven when building the final package, starting embedded jetty etc and this has worked out quite well.
I've just discovered that the scala-maven-plugin supports both continuous compilation & testing, as well as cross-compilation (Java + Scala). So it's possible to use it over a pure Java build and get all the continuous build goodness.
Recently, I have had a need for a solution to this. Having been learning scala and finding about the goodness of sbt ~test, I want to apply it to Java projects that do not have continuous test.
Using the scala-maven-plugin that you mentioned, I have created a github seed that will run Java Junit tests everytime I save a Java source or a Java test.
Check it out:
https://github.com/ailveen/maven-scala-java-continuous-test
The project is very simple right now (contains only Java files because that is my current need) but in the future I hope to add scala test (or specs2 or scalacheck) so it works with mixed java and scala files.
Hope you find it useful.
It is not exactly for Maven, but JUnit Max does continuous testing and if you're on Eclipse it might be the tool you would like to check out

Categories

Resources