Why the combination of Maven with Git? [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I started a job in a company where they use Maven in combination with Git. I haven't worked with Maven before and I hope my question isn't too stupid. Why should one use Maven in combination with Git? From what I read Maven has a local, a central and can have a remote repository where it can find it's dependencies. This should enable a team of programmers to work together on the same code. What is the purpose of Git here? Would it be possible to program in a Team just with Maven and without the help of Git?

Well maven and git are for different purposes:
GIT holds the sourcecode of your application
MAVEN is used for dependency management. It holds the binary dependecies of your application. It also creates a abstraction of the used IDE. One developer can use eclipse and another intellij. The project can also be built with the commandline.

I guess it would be possible to work with just Maven. It might even not be totally horrible. However, Maven is system for distributing releases (even if they are snapshots or whatever). It is a totally different tool, than what a version control software is. I guess you could say Maven is the just the "distributed" part without the "version control" part of DVCS systems such as git.
A real version control can do a lot of stuff Maven does not support directly, such as merging, diffs, commit logs. I'm sure it would be possible to build an actual, fully featured version control system on top of Maven, with suitable plugins, but it would be very klunky and awkward to use. The likes of git already do all this, and they have been designed to do it from the start, so they do it better than some hack on top of Maven could ever do, so I doubt nobody has actually tried.
I mean, you could do version control with just shared folder, naming conventions, manual log files, an IM group chat (irc channel) for synchronizing between developers, stock diff tools etc for comparing stuff, etc. It would just be horrible to use and very easy to "break" (in this case, easy to corrupt entire project and all its history). There has been a long evolution of version control systems, you can start reading about it for example here, and starting do it on top of Maven would be like jumping 30 years back in time.

When using Maven, your project's dependencies are well defined in pom.xml which is good for collaborative development as addition of dependencies doesn't require other developers to be informed as Maven automatically handles dependencies itself by downloading dependencies.
Git is used for distributed version control which is very good to keep track code changes in your project.
Basically, these two tools make collaborative development easy. However, this is just a crash course description, there are many of advantages.

Related

How can I share JAR file dependecies on a network between Eclipse users? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I want to have a central JAR repository so all Eclipse users can import JAR dependencies from a central location no matter what operating system they are using.
I thought about Windows file sharing, but it gets complicated in Linux.
I thought Apache Ivy could help but I could not find out how to use it for my purpose.
If you are going to mention Maven, Ant, Ivy or any other Apache software, please show my a simple document where it explains how to use it as a repository.
If you don't like a file sharing method [FTP, etc], go for a source code sharing method [git, SVN, etc]
I may do with git, since it is cross platform, and can do many more things.....
Anyway it needs a local copy. But I think its good since otherwise compiling may waste lot of time.
Since eclipse has git plugins, it'll be an added advantage.
http://www.eclipse.org/egit/
Maven connects to a Nexus, which is the actual repository server you'd need to stand up and configure. You can start adding your collection of JARs and other artifacts, and can configure Maven to be your build and dependency management tool for your teams' projects.
The Maven/Nexus combination is certainly agnostic to an OS. As long as you install maven (or, more typically, an IDE plugin), and have network connectivity, you're good to go.

Eclipse vs. OSGi Framework ? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Should I create an eclipse plugin with target platform OSGi or without it ?
from Eclipse help
"If you do not intend to use the Eclipse extension registry, then you should use the OSGi framework option. If you select the OSGi framework option, you will not end up with dependencies on the runtime layer. Moreover, PDE will restrict the available templates and the code generated for you to the OSGi layer."
What I can't do when I choose OSGi? Why would I choose OSGi when its less powerful for plugins ?
This setting just adjusts the dependencies of the soon-to-be-created plugin. You can create a simple bundle and add dependencies to the eclipse infrastructure bundles - will you manage the versioned dependencies by hand?
Also, depending on this setting the wizard will offer to create project scaffolding based on a template for the selected eclipse version; f.e. help, preferences, UI contributions, and whatever else you have installed that has a registered template that applies.
In essence, if your plugin will only be used within eclipse, you don't need to think about it, just set the desired Eclipse version. If your plugin should be also usable in other OSGi frameworks, only then is any decision necessary.
Our simple rule of thumb that handles almost all cases is, if it does not provide any UI functionality, then it is an OSGI bundle. In this case, none of the SWT specific libraries and frameworks are being used.
You asked "What I can't do when I choose OSGi? Why would I choose OSGi when its less powerful for plugins ?", so I will ask "are you writing a plugin, or an OSGi bundle"?
They are not the same thing. A plugin is a bundle, with the UI extensions added on. This is not a matter of it (OSGi project) being less powerful, it simply doesn't provide the extra functionality required to code a UI, as this is NOT part of OSGi. So if you are writing a pure OSGi bundle, then create an OSGi project, without the extra dependencies and artifacts that are simply not required. If you are writing a UI, then it should be a plugin project.

What's the best way to manage multiple dependent projects in Git or Mercurial? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have a dozen Java projects that depend on each other, and I frequently make changes that cross-cut all of them. However, many of the projects are libraries that could be used independently of each other as well.
Right now I use mercurial subrepos, which works well except that very few third-party tools support it - it's hard to set up code review tools, continuous integration, etc.
What's the best way to address this situation? Split everything into separate projects and build separate JARs? Migrate to git and use git subrepositories? Check everything in to a single repo and accept that I have to check out everything to use anything? Something else?
I would say the best way to do it would be to cut your dependencies so that they can reference as external jars. This way when you make potentially breaking changes you don't necessarily have to fix the affected areas straight away. Since they depend on a previously built jar it allows you to properly isolate your coding. If you use something like Maven to manage your dependencies you will also benefit from the ability to more easily keep track of the different versions of your jars.
If the subprojects are sufficiently autonomous, I would advise setting them up as separate maven projects with separate VCS repos.
This will give you the modularity you need paired with a working dependency management.

Best Eclipse version for Java development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
There are many editions of Eclipse for Java development. I am trying out MyEclipse and am pretty impressed with the out-of-box experience. Before I get too comfortable with it, I would like to find out if it is the best edition available. Feel free to list free or commercial packages, but for the sake of other readers, please mention if there is a cost.
Considerations
I am mostly concerned with the code editing experience. Here is a list of some factors that would affect my decision:
Extensive support for refactoring
Code suggestions (like suggesting refactorings)
Easily configurable keyboard shortcuts
Easily configurable colours (I use dark colour schemes, and setting this up with MyEclipse was hell; that said, I only really need to do it once)
Excellent debugging support
Source control plugins (SVN or git if one exists)
Don't care about GUI designers
I am aware that there is a thread discussing the best IDE for Java development; however, most of the responses do not detail recommended editions of Eclipse.
I'm always just downloading classic edition and just add plugins I need. That way I keep Eclipse as lean as possible.
all of the above except the color stuff works great with vanilla Eclipse 3.4 + Subclipse. if you find an easy way to customize colors in Eclipse, please let us know.
Until then you're stuck with having to manually change each color.
Actually almost all the things you mentioned are present in the plain old "Eclipse IDE for Java Developers" (85MB) at eclipse.org. It has a much smaller footprint than some of the others like MyEclipse. You'll need to install an SVN plugin, though.
Agree with Marko and Epaga
I have Eclipse 3.4 (Ganymede) with following additional plugins (links are the update site URLs):
Subclipse for Subversion
Spring IDE for Spring. Favourite features: Advanced spring xml completion and bean visualisations.
m2eclipse for Maven. Favourite features: transitive dependency tree and graph visualisations.

Complex profiles in maven [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 14 years ago.
Improve this question
I've been looking at profiles in maven for selecting different sets of dependencies. This is fine when you want to build say a debug build differently from a release build. My problem is that I want to do a fair bit more than this. For my application (Mobile Java app where J2ME is just one target among many) there may be a large number of possible combinations of variations on a build.
Using some made-up command line syntax to illustrate what I'd like to see, I'd imagine typing in something like
mvn -Pmidp,debug,local-resources
What Maven does in this case is to build three different builds. What I want to do is use those three (Or more, or less) switches to affect just one build. So I'd get a MIDP-targetting debug build with 'local resources' (Whatever that might mean to me - I'm sure you can imagine better examples).
The only way I can think of doing this would be to have lots and lots of profiles which becomes quite problematic. In my example, I'd have
-Pmidp-debug-localresources
-Pmidp-release-localresources
-Pmidp-debug-remoteresources
-Pmidp-release-remoteresources
...
Each with its own frustratingly similar set of dependencies and build tag.
I'm not sure I've explained my problem well enough, but I can re-write the question to clarify it if comments are left.
UPDATE:
The question isn't actually valid since I'd made a false assumption about the way maven works.
-Pmidp,debug,local-resources
does not do 3 builds. It in fact enables those 3 profiles on one build, which was ironically what I was looking for in the first place.
The Maven way is to create a lot of artifacts with less complexity. I'd say your best bet is to abstract the common parts of each build into a separate artifact, then create a project for each build that defines the build specific parts. This will leave you with a lot of projects, but each will be much simpler.

Categories

Resources