Is there a maven plugin that executes other maven plugins? I swear there was one and now I can not find it.
Thanks!
If you don't find anything else, you could always write your own with the help of The Mojo Executer. It's a library that allows you to easily write plugins that invoke other plugins.
I'm still not quite sure I understand your answer to Waldheinz though. Maybe you could explain exactly why you need to do this? Maybe there's an alternative solution that doesn't involve chaining plugins.
Related
That looks easy enough: search the net in which package they are, copy the dependency into your pom.xml and here you go!
But I didn't didn't anything that I could use as a dependency.
Not much of a surprise, other people had the same problem, and solutions can found here https://stackoverflow.com/a/29270114/4142984 in combination with https://stackoverflow.com/a/15692230/4142984 .
In other words, those solutions suggest to get the jar manually and hard-link it in you build-path. It worked, though.
But isn't maven supposed to do that?
Question is: what did I miss, to tell maven to do this.
And I'm using maven with eclipse, just in case this would make a difference.
The links you provided suggest adding a JAR to your project CLASSPATH. That's not using Maven.
If you want to have Maven manage that dependency, and it's not in a Maven Central repo, you need to do an mvn install to your enterprise or local Maven repository.
I'm not if this Maven plugin is what you need. Maybe you can consider that as well.
I have found useful tools to do this in eclipse like Classpath Helper, but is there any plugin or way in intellij idea to find unused jar files ?
I'm sure you know how to use the IDEA Dependency Analysis tool to find library dependencies, and while that could get you some of the way it's of course not enough.
The problem and fact is that there is no way of finding unused JARs by way of static analysis, since it is possible to refer to and create any class in any dependency by way of reflection/IoC/whatnot these days.
So, the best you can "hope" for is a tool that can tell which JARs are not explicitly referenced by your code - curiously that is absent from IDEA as far as I know (but I would love to be corrected on that point!)
Cheers,
You should really be using maven and determining each module's dependencies manually. Classpath Helper is an astonishingly bad way to tell what jars you're using.
I'm trying to check out slf4j-simple-1.6.2 from a trusted repository (preferably, SLF4J's official repo) and pull it down into an Eclipse project. I'm doing this because I need to tweak SLF4J Simple's code so that it binds to my own logging implementation.
I'm hoping there is a way to do this without having to use Maven, because I've never used Maven before and feel much more comfortable running Ant builds.
Nevertheless, I've searched SLF4J's site high and low and cannot find any trusted links to their repository.
Even once I get the project imported into Eclipse, I still need to figure out how to get it building with Ant.
Could someone please help me:
Find the repo
Confirm whether an Ant build is possible
Thanks in advance!
The zip download here also contains the sources.
The official source code repository is hosted on GitHub. However, I believe you are doing it the wrong way.
The idea of SLF4J is to have a dependency on slf4j-api and let the developer to add exactly one binding. Instead of tweaking original bindings just write your own one. Of course you can use simple binding a starting point, but modifying existing open source libraries and maintaining patched versions is a lot of work.
As you said, slf4j is present in the official Maven repository.
So basically, you have 2 simple solutions without using Maven:
Download the JAR / sources / javadocs from this Maven repository, and copy them in your own project directory.
Use Ivy. This is an extension of Ant to give a better dependencies management. It can connect to Maven repositories. So you will be able to retrieve your slf4j dependency without having to use Maven.
We have a multiwar project and with various people working on the project a lot of times, lots of unused jars are still specified as dependencies, is there any way , to check which jars are not used at all, but nonetheless, are being referred to as a dependency?
I hope maven already has support for something like this, considering its such a powerful tool.
Run mvn dependency:analyze. It should do the work.
In a bigger project we might be using tons of JARs. How do I find out which JARs are being used by a certain module/package in the project (not the whole project). Any tool, technique, etc?
Bigger projects typically use a build tool like maven or ant. maven has the maven dependency plugin to list the dependencies for a particular project which you invoke by mvn dependency:list. In case of ant, it depends on the way the build script is written.
Maybe you should give more details about your project environment and you may get better answers.
The various code obfuscators, reducers etc can help.
Check out:
http://jarg.sourceforge.net/
http://www.alphaworks.ibm.com/tech/jax/
http://www.e-t.com/jshrink.html
http://proguard.sourceforge.net/
http://www.fightingquaker.com/jaropt/
btw, this list was acquired from http://www.javakb.com/Uwe/Forum.aspx/java-programmer/34365/How-to-create-a-JAR-that-contains-only-the-class-files