difference between Gradle and accurev - java

Can any one explain the difference between Accurev and Gradle.
I am trying to use it in eclipse mars version.
I have a project got from AccuRev how can I import it as a gradle or as AccuRev?

Here you go.
AccuRev -> https://en.wikipedia.org/wiki/AccuRev_SCM
Gradle -> https://en.wikipedia.org/wiki/Gradle

AccuRev is not a build system or project format, it's a source control management system like cvs, subversion, git, tfs, mercurial etc.
Gradle is a build system and project format similar to maven, but with groovy scripting, so you essentially get the declarative style of maven plus the imperative style of ant.
You would keep/promote a gradle project to AccuRev, but you would need to create the gradle project first.
So first things first you need to figure out what kind of project you already have as that has not been determined.

It's pretty simple, a little search on your favorite search engine could help you to understood :
AccuRev: Versioning tool (like git)
Gradle: Build tool (like maven)

Related

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.

How to make maven use separate target folders for every version of program?

As example, i have program with version 0.0.1. Maven must create separate folder for it - "target/0.0.1/" instead of "target/". It must be done for version "0.0.2", "0.0.3", etc.
I use Eclipse & it's Maven:
Version: Oxygen.3a Release (4.7.3a)
Build id: 20180405-1200
JDK 1.8.0_172
Maven doesn't work that way, and trying to do something like that will lead to a path of suffering. Options I see include
Creating a separate assembly (and output Jar) for each version (see Maven Assembly Plugin)
Create a multi-project reactor with a separate output configuration for every project. Keep common code in one project that you link as dependency from the others. Possibly use the maven-shade-plugin to re-link the packages in your common project into the individual output projects
As you can see, both of these approaches are pretty hacky and require advanced Maven skills. It would be much easier to have parameterized builds where you pass in the output version. But that would make sense on a CI server like Jenkins.

Including .jar files in Github for consistency

I am new to using github and have been trying to figure out this question by looking at other people's repositories, but I cannot figure it out. When people fork/clone repositories in github to their local computers to develop on the project, is it expected that the cloned project is complete (ie. it has all of the files that it needs to run properly). For example, if I were to use a third-party library in the form of a .jar file, should I include that .jar file in the repository so that my code is ready to run when someone clones it, or is it better to just make a note that you are using such-and-such third-party libraries and the user will need to download those libraries elsewhere before they begin work. I am just trying to figure at the best practices for my code commits.
Thanks!
Basically it is as Chris said.
You should use a build system that has a package manager. This way you specify which dependencies you need and it downloads them automatically. Personally I have worked with maven and ant. So, here is my experience:
Apache Maven:
First word about maven, it is not a package manager. It is a build system. It just includes a package manager, because for java folks downloading the dependencies is part of the build process.
Maven comes with a nice set of defaults. This means you just use the archtype plugin to create a project ("mvn archetype:create" on the cli). Think of an archetype as a template for your project. You can choose what ever archetype suits your needs best. In case you use some framework, there is probably an archetype for it. Otherwise the simple-project archetype will be your choice. Afterwards your code goes to src/main/java, your test cases go to src/test/java and "mvn install" will build everything. Dependencies can be added to the pom in maven's dependency format. http://search.maven.org/ is the place to look for dependencies. If you find it there, you can simply copy the xml snippet to your pom.xml (which has been created by maven's archetype system for you).
In my experience, maven is the fastest way to get a project with dependencies and test execution set up. Also I never experienced that a maven build which worked on my machine failed somewhere else (except for computers which had year-old java versions). The charm is that maven's default lifecycle (or build cycle) covers all your needs. Also there are a lot of plugins for almost everything. However, you have a big problem if you want to do something that is not covered by maven's lifecycle. However, I only ever encountered that in mixed-language projects. As soon as you need anything but java, you're screwed.
Apache Ivy:
I've only ever used it together with Apache Ant. However, Ivy is a package manager, ant provides a build system. Ivy is integrated into ant as a plugin. While maven usually works out of the box, Ant requires you to write your build file manually. This allows for greater flexibility than maven, but comes with the prize of yet another file to write and maintain. Basically Ant files are as complicated as any source code, which means you should comment and document them. Otherwise you will not be able to maintain your build process later on.
Ivy itself is as easy as maven's dependency system. You have an xml file which defines your dependencies. As for maven, you can find the appropriate xml snippets on maven central http://search.maven.org/.
As a summary, I recommend Maven in case you have a simple Java Project. Ant is for cases where you need to do something special in your build.

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.

How do I build this Maven project from source?

I want to build the LanguageTool Java project from source. This page gives basic instructions for obtaining the "Maven artifact" with all the sources:
http://languagetool.org/java-api/
I'm an expert Java developer but I've never used Maven before. Can someone please tell me how to get the LanguageTool project and all source code into Eclipse so I can modify and build it?
Thanks in advance...
At the bottom of the page you linked (Language Tool) is another link to the svn repository. That's where you'll get the source code and instructions on how to build the tool yourself.
In general, open source projects will highlight the maven artifact as it allows others to use their code in the easiest way possible. Only a few folks like to build the code themselves so the links to the source repositories are often less conspicuous.
There is no automated way to do this.
Best is to start a basic maven project (manually or through a Maven Archetype, import the sources in the Standard Directory Layout, and start adding dependencies to the pom.xml in order to get it to compile.
Libraries like commons,lucene,... are pretty easy to find in the various maven repositories).
Other libs you will probably have to install yourself in your local repository or remote repository.
There's a maven plugin for eclipse if that is your preferred IDE.

Categories