walkmod-rawclasspath-plugin

Walkmod plugin to resolve the user classpath and provide it to code transformations

License

License

GroupId

GroupId

org.walkmod
ArtifactId

ArtifactId

walkmod-rawclasspath-plugin
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

walkmod-rawclasspath-plugin
Walkmod plugin to resolve the user classpath and provide it to code transformations
Project URL

Project URL

https://github.com/rpau/walkmod-maven-plugin
Source Code Management

Source Code Management

https://github.com/rpau/walkmod-rawclasspath-plugin

Download walkmod-rawclasspath-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/org.walkmod/walkmod-rawclasspath-plugin/ -->
<dependency>
    <groupId>org.walkmod</groupId>
    <artifactId>walkmod-rawclasspath-plugin</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.walkmod/walkmod-rawclasspath-plugin/
implementation 'org.walkmod:walkmod-rawclasspath-plugin:1.0.2'
// https://jarcasting.com/artifacts/org.walkmod/walkmod-rawclasspath-plugin/
implementation ("org.walkmod:walkmod-rawclasspath-plugin:1.0.2")
'org.walkmod:walkmod-rawclasspath-plugin:jar:1.0.2'
<dependency org="org.walkmod" name="walkmod-rawclasspath-plugin" rev="1.0.2">
  <artifact name="walkmod-rawclasspath-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.walkmod', module='walkmod-rawclasspath-plugin', version='1.0.2')
)
libraryDependencies += "org.walkmod" % "walkmod-rawclasspath-plugin" % "1.0.2"
[org.walkmod/walkmod-rawclasspath-plugin "1.0.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.walkmod : walkmod-core jar [2.0.0,3.0.0)

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

walkmod-rawclasspath-plugin

Walkmod plugin to resolve the classpath of a project that needs to be build manually or by script (without building tools such as maven or gradle).

Usage

Specifically, this plugin makes available the classpath of maven project for the code transformations when you run walkmod. In order to access to the project classpath (the java.lang.ClassLoader element) from your code transformation, you just need to add the setter operation for the class loader.

    public class MyVisitor extends VisitorSupport {

    private ClassLoader classLoader;

    public void setClassLoader(ClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    public void visit(MethodCallExpr md, VisitorContext vc){
        ...
    }

In order to use this plugin (for walkmod >= 2.0), you just need to add the configuration provider specifying your classpath (the project .classes and the dependencies)

<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD"  "http://www.walkmod.com/dtd/walkmod-1.1.dtd" >
<walkmod>
  ...
  <conf-providers>
    <conf-provider type="rawclasspath">
       <param name="classpath">bin;lib/guava.jar;lib/log4j.jar</param>
    </conf-provider>
  </conf-providers>
  ...
</walkmod>

Contributing

If you want to hack on this, fork it, improve it and send me a pull request.

To get started using it, just clone it and call mvn install.

Versions

Version
1.0.2
1.0.1
1.0