Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:28:36+00:00 2026-06-05T11:28:36+00:00

A ClassNotFoundException is being thrown in a plugin I’ve developed. The class which can’t

  • 0

A ClassNotFoundException is being thrown in a plugin I’ve developed. The class which can’t be founf definitely exists and its associated project is included as a dependency in the executing project’s pom.xml file as follows:

<dependency>
    <groupId>com.example</groupId>
    <artifactId>project-one</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

My plugin is included the executing pom.xml as follows:

<build>
<plugins>
 <plugin>
   <groupId>com.example</groupId>
                <artifactId>project-two-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <configuration>
                           <customSettingOne>
                               setting
                           </customSettingOne>
                        </configuration>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>some-task</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

My plugin class is as follows:

/**
 *  @goal some-task
 *
 *  @requiresDependencyResolution compile
 */

public class MyPluginMojo extends AbstractMojo {

    /**
     * Directory to save the CSV files to.
     *
     * @parameter alias="customSettingOne"
     * @required
     */
    private File customSettingOne;

}

I have tried this code using:

Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)

and the embedded version used by Eclipse m2e

Embedded (3.0.2/1.0.200.20111228-1245

I get a ClassNotFoundException when my plugin code tried to load the class from ProjectOne.

Anyone have any ideas how I can get to the bottom of this? Is it possible to inspect or dump out the classpath being used in the plugin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:28:37+00:00Added an answer on June 5, 2026 at 11:28 am

    I would check here first:

    Guide to Maven Classloading

    and if that doesn’t help, maybe a bit of diagnostic code like the following:

    package stackoverflow;
    
    import java.net.URL;
    import java.net.URLClassLoader;
    
    public class PrintClassLoader {
        public static void main(String[] args) {
            PrintClassLoader pcl = new PrintClassLoader();
            pcl.printClassLoader(pcl.getClass().getClassLoader());
        }
    
        public void printClassLoader(ClassLoader classLoader) {
            if (null == classLoader) {
                return;
            }
            System.out.println("--------------------");
            System.out.println(classLoader);
            if (classLoader instanceof URLClassLoader) {
                URLClassLoader ucl = (URLClassLoader) classLoader;
                int i = 0;
                for (URL url : ucl.getURLs()) {
                    System.out.println("url[" + (i++) + "]=" + url);
                }
            }
            printClassLoader(classLoader.getParent());
        }
    }
    

    For example will print something like:

    --------------------
    sun.misc.Launcher$AppClassLoader@35ce36
    url[0]=file:/D:/dev/workspaces/3.6/all/Z_temp/target/classes/
    url[1]=file:/D:/dev/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar
    url[2]=file:/D:/dev/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
    url[3]=file:/D:/dev/.m2/repository/commons-io/commons-io/2.1/commons-io-2.1.jar
    --------------------
    sun.misc.Launcher$ExtClassLoader@757aef
    url[0]=file:/C:/java/jdk/jdk1.6.0_31/jre/lib/ext/dnsns.jar
    url[1]=file:/C:/java/jdk/jdk1.6.0_31/jre/lib/ext/localedata.jar
    url[2]=file:/C:/java/jdk/jdk1.6.0_31/jre/lib/ext/sunjce_provider.jar
    url[3]=file:/C:/java/jdk/jdk1.6.0_31/jre/lib/ext/sunmscapi.jar
    url[4]=file:/C:/java/jdk/jdk1.6.0_31/jre/lib/ext/sunpkcs11.jar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I use try { Class.forName(my.package.Foo); // it exists on the classpath } catch(ClassNotFoundException
The code below fails on the line: Class.forName(oracle.jdbc.driver.OracleDriver); with the error: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver The
The signature for readObject is: private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException; which takes
I'm getting ClassNotFoundException when running ant test target. All path and libraries exists including
I cannot seem to get Class.forName(String) to not throw a ClassNotFoundException . For example,
public class ReportView extends JFrame { Connection con=null; void showReport() throws SQLException, ClassNotFoundException, JRException
I got this error 'java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model' when I run my java web service which
I am getting this exception in my java project Caused by: java.lang.ClassNotFoundException: org.apache.axiom.om.OMDataSource at
I have seen this thread ClassNotFoundException Thrown using MapView but no help for me.
I've encounted an error trying to implement Apache commons-compress in my Java application: java.lang.ClassNotFoundException:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.