Hello,

- I am trying to extend the ckjm-mojo 
(http://mojo.codehaus.org/ckjm-maven-plugin/ckjm-mojo.html).
- ckjm needs the dependencies of the project to report on
- Right now I have the following:

--- snip ---
    /**
     * The set of dependencies required by the project
     * 
     * @parameter default-value="${project.dependencyArtifacts}"
     * @required
     * @readonly
     */
    private java.util.Set<Artifact> dependencyArtifacts;

    /**
     * Extends classpath with dependencies. This is needed, as bcel otherwise
     * will raise ClassNotFoundExceptions.
     */
    void extendClassPathWithDependencies() {        
        getLog().debug("[ckjm:cjkm] dependencies: " + 
dependencyArtifacts.toString());
        StringBuilder classpath = new StringBuilder(System.getProperty(
                "java.class.path", ""));
        for (Artifact artifact : dependencyArtifacts) {
            classpath.append(File.pathSeparator);
            classpath.append(artifact.getFile().getAbsolutePath());
        }
        getLog().info("[ckjm:cjkm] Setting classpath to: " + 
classpath.toString());
        System.setProperty("java.class.path", classpath.toString());
    }
--- snap ---

Is there an automated way to extend the classpath just for this mojo?

Best Regards
Mirko

Reply via email to