Let\'s say I have a project that uses a dependency that can be found in the Maven repository. However, lets also say that the jar file that will be downloaded is NOT in a format
Downloading the source packages using Maven is easy:
log4j
log4j
1.2.16
sources
How to configure Maven to expand this dependency and then compile it's contents is beyond me....
Have you considered an ANT solution? The ivy plug-in provides it with Maven-like abilities and the groovy plug-in can be used to script your special build logic:
Ivy uses "configurations" (similar to Maven scopes) to group dependencies.
In this example the "sources" configuration holds the downloaded source packages. These are placed into a referenced fileset, which can be processed sequentially by the groovy task.
Each downloaded source jar is unzipped into the "build/src" directory:
project.references.sourcezips.each {
ant.unzip(src: it, dest: properties["src.dir"])
}
Each source package dependency uses the "sources" configuration. This maps directly to the "sources" scope of the Maven module.