Skip to content

Instantly share code, notes, and snippets.

View ALRubinger's full-sized avatar

Andrew Lee Rubinger ALRubinger

View GitHub Profile
@maxandersen
maxandersen / readme
Last active August 29, 2015 14:02
how to send pdfs to a certain picky expense system
Install "sendEmail"
on OSX I did that with 'brew install sendemail'
on fedora/red hat 'yum sendEmail' should work too (not tested).
http://caspian.dotconf.net/menu/Software/SendEmail/
Then use the script below and do this in the dir with your pdf's for the script (it will just take all *.pdf).
@kpiwko
kpiwko / shrinkwrap-resolver-use-cases.asciidoc
Last active December 29, 2021 08:51
ShrinkWrap Resolvers Use Cases

ShrinkWrap Resolvers

Introduction to ShrinkWrap Resolvers

Often we don’t control the construction of these libraries, and we certainly shouldn’t be in the business of re-assembling them (and hence further differentiating our tests from the our production runtime deployments). With the advent of Maven and other build systems, typically thirdparty libraries and our own dependent modules are obtained from a backing software repository. In this case we supply a series of coordinates which uniquely identifies an artifact in the repository, and resolve the target files from there.

That is precisely the aim of the ShrinkWrap Resolvers project; it is a Java API to obtain artifacts from a repository system. Currently implemented are grammars and support for Maven-based repository structures (this is separate from the use of Maven as a project management system or build tool; it’s possible to use a Maven repository layout with other build systems).

ShrinkWrap Resolvers is comprised of the following module

@tommysdk
tommysdk / gist:3706436
Created September 12, 2012 13:00
ShrinkWrap: How to replace a file in an artifact resolved with MavenDependencyResolver.
public static WebArchive getTestPreparedArchive() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "service.war")
.addClasses(MyClass1.class, MyClass2.class); // add classes needed for the test
// Resolve the needed dependency independently, so we can replace the production persistence.xml inside the archive
Collection<JavaArchive> archives = DependencyResolvers.use(MavenDependencyResolver.class)
.artifact("se.diabol.persistence:Persistence_Framework:jar:0.1-SNAPSHOT").resolveAs(JavaArchive.class);
// Resolve the actual archive
JavaArchive p = null;