On 7/09/2010 4:40 PM, Jeremias Maerki wrote:

I guess we're in a "religious" dispute here, like PC vs. Mac. So we
can't expect to reach a consensus.

Well, certainly a discussion of preference. I know it gets religious for some Java folks, but myself I don't mind too much so long as nobody tries to force their choice on me. I can use Maven without having to care what others use or force it on them. I'm only weighing in on this discussion to say that I'd like the option for maven builds if it doesn't get in anyone else's way, and address some possible misunderstandings about maven.

I like dealing with maven in projects because for me it is a known quantity and imposes some consistency on projects that I personally like. OTOH, I manage ok if a project doesn't use maven, at least so long as I don't have to wrangle the guts of its build system.

Anyway, I won't to stand in the way
if something is added to FOP that can help some users. [snip] just because Maven
can't include a simple JAR that is not in a repository.

Not strictly true. One option is to use <scope>system</scope> with an explicit path to the jar.

Maven doesn't have a wild-card "include everything under lib/" though, and using system scope to fudge in local depencies is a bit of a hack.

http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies


Usually what you'd do if you have a jar you want to use - but no repo or pom for it - is drop the jar you want to use into your local ~/m2/ (or wherever you keep your local repository, ie download cache) then declare a dependency on it in your pom.xml. This is within "a repository" but it's only your local repo, it doesn't involve any network access or anything except putting a file in a particular place. Maven will look for the dependency in a location defined by the repo layout. So if I declared

<dependency>
  <groupId>local</groupId>
  <artifactId>somejar</artifactId>
  <version>2.2</version>
</dependency>

... then it'd look for local/somejar-2.2.jar within my local repository. If I put the jar where it should be found, no problem.

I don't personally find that to be any worse than dropping everything in lib/ ... and I find it makes it a LOT easier in the long run to let mvn take care of the mess of secondary (transitive) dependencies involved in using things like Hibernate.

(OK, so maven does whine annoyingly about not being able to find the pom.xml for the artifact, which bugs me - but it works fine nonetheless).

> But I consider
> Maven viral as we're seeing here. Due to its inflexibility, projects
> are almost forced to adopt it to keep everyone happy,

I can't speak for the obsolete Maven 1.x, but that's not true of 2.x . To keep everyone happy it *does* help to publish artifacts to a maven repository (be it Central or somewhere else) but there's no need to get Maven anywhere near your builds if you don't want to, and there's no need for the people maintaining the project and doing the development work to have anything to do with pushing project releases to maven central.

If you *do* want to create and push maven artifacts yourself but don't want to use Maven in builds, a Maven artifact can be created with the "cp" command and a text editor, or with an Ant task to spit out a suitable generated pom.xml . No biggie.

You can use Maven builds with jars not created or managed with Maven, you can use Ant to produce Maven artifacts, and you can use Ant to consume Maven-produced artifacts. It doesn't really force anything on you at all.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

Reply via email to