Maven, a Yiddish word meaning accumulator of knowledge , began as an attempt to simplify the build processes in the Jakarta Turbine project. There were several projects, each with their own Ant build files, that were all slightly different.
We wanted a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information, and a way to share JARs across several projects.
The result is a tool that can now be used for building and managing any Java-based project. We hope that we have created something that will make the day-to-day work of Java developers easier and generally help with the comprehension of any Java-based project.
In order to attain this goal, Maven deals with several areas of concern:. We have come to feel that plug-ins are the wrong level of abstraction, and prefer language-based tools like Gradle and Rake instead, because they offer finer-grained abstractions and more flexibility long term. I used ant to build software my entire career and I have always considered the actual "buildit" part of the dev work being a necessary evil.
A few months back our company grew tired of not using a binary repo aka checking in jars into the vcs and I was given the task to investigate this.
Started with ivy since it could be bolted on top of ant, didn't have much luck getting my built artifacts published like I wanted. I went for maven and hacked away with xml, worked splendid for some simple helper libs but I ran into serious problems trying to bundle applications ready for deploy. Hassled quite a while googling plugins and reading forums and wound up downloading trillions of support jars for various plugins which I had a hard time using.
But from day one my mood started to improve. I was getting somewhere. Took me like two hours to migrate my first ant module and the build file was basically nothing. Easily fitted one screen.
The big "wow" was: build scripts in xml, how stupid is that? From then on I been on a constant roll, for every problem I faced so far there is a simple and elegant solution.
I think these are the reasons:. Now I spend my days trying to think up new features to add to our build process.
How sick is that? It's also much easier to manage native builds. Ant and Maven are effectively Java-only. Some plugins exist for Maven that try to handle some native projects, but they don't do an effective job. Ant tasks can be written that compile native projects, but they are too complex and awkward. We do Java with JNI and lots of other native bits. Gradle simplified our Ant mess considerably. When we started to introduce dependency management to the native projects it was messy.
We got Maven to do it, but the equivalent Gradle code was a tiny fraction of what was needed in Maven, and people could read it and understand it without becoming Maven gurus. I agree partly with Ed Staub. Gradle definitely is more powerful compared to maven and provides more flexibility long term. After performing an evaluation to move from maven to gradle, we decided to stick to maven itself for two issues we encountered with gradle speed is slower than maven, proxy was not working.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Why use Gradle instead of Ant or Maven? Asked 12 years, 3 months ago. Active 5 years, 2 months ago. Viewed k times. Next, the modules themselves are created. The one in the module subdirectory will be similar.
In this example, the sources are found in the parent directory.. In particular, expect that site reports may include all sources, for example. Depending on your use case, Maven can support this. Using Maven When You Can't Use the Conventions There is a common misconception that Maven can't build a project that doesn't conform to certain directory structures or build practices.
Why isn't this recommended? First, download Maven and follow the installation instructions. After that, type the following in a terminal or in a command prompt:. Depending upon your network setup, you may require extra configuration. Check out the Guide to Configuring Maven if necessary. If you are using Windows, you should look at Windows Prerequisites to ensure that you are prepared to use Maven on Windows. You need somewhere for your project to reside.
Create a directory somewhere and start a shell in that directory. On your command line, execute the following Maven goal:. If you have just installed Maven, it may take a while on the first run. This is because Maven is downloading the most recent artifacts plugin jars and other files into your local repository. You may also need to execute the command a couple of times before it succeeds. This is because the remote server may time out before your downloads are complete.
Don't worry, there are ways to fix that.
0コメント