Custom maven plugin execution fails with classnotfound












0















I am writing what is essentially my first maven plugin, so this might just be a lack of google skills, but here goes.



I am using the maven-plugin-plugin to create a plugin



        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5.2</version>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>


I am using maven version 3.5.2.



The plugin project builds fine, but when I try to use it in another project it fails with this error:



Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.graph.Dependency
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
....(Lots of google.inject stuff)....
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)


After some googeling I found this stackoverflow post which I don't fully understand, but I did look at the bugreport and changed my Dependency plugin version (in both the plugin project and the consumer project because I have no idea what I'm doing :) )



The error is still there in unchanged form. The error is happening in the generatesources phase which is where my plugin is running, and removing the plugin makes the error disappear, so I am fairly certain that my plugin is to blame.



Can someone explain in simple terms what is happening, and help me with a solution? Thank you much in advance.



Here is the entire plugin POM



<project>
<modelVersion>4.0.0</modelVersion>

<groupId>...</groupId>
<artifactId>...</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>...</name>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>



<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.5.2</version>
</dependency>

<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5.2</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<version>3.0.1</version>
</dependency>

<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId>
<version>5.1.g</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.squareup</groupId>
<artifactId>javapoet</artifactId>
<version>1.11.1</version>
</dependency>



<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5.2</version>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>






EDIT: I tried adding



    <dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-api</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.8</version>
</dependency>


But the problem persists. I tried adding it to both projects as well. Same result.










share|improve this question





























    0















    I am writing what is essentially my first maven plugin, so this might just be a lack of google skills, but here goes.



    I am using the maven-plugin-plugin to create a plugin



            <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-plugin-plugin</artifactId>
    <version>3.5.2</version>
    <executions>
    <execution>
    <id>default-descriptor</id>
    <phase>process-classes</phase>
    </execution>
    </executions>
    </plugin>


    I am using maven version 3.5.2.



    The plugin project builds fine, but when I try to use it in another project it fails with this error:



    Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.graph.Dependency
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    ....(Lots of google.inject stuff)....
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)


    After some googeling I found this stackoverflow post which I don't fully understand, but I did look at the bugreport and changed my Dependency plugin version (in both the plugin project and the consumer project because I have no idea what I'm doing :) )



    The error is still there in unchanged form. The error is happening in the generatesources phase which is where my plugin is running, and removing the plugin makes the error disappear, so I am fairly certain that my plugin is to blame.



    Can someone explain in simple terms what is happening, and help me with a solution? Thank you much in advance.



    Here is the entire plugin POM



    <project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>...</groupId>
    <artifactId>...</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>maven-plugin</packaging>

    <name>...</name>

    <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    </properties>



    <dependencies>
    <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-plugin-api</artifactId>
    <version>3.5.2</version>
    </dependency>

    <!-- dependencies to annotations -->
    <dependency>
    <groupId>org.apache.maven.plugin-tools</groupId>
    <artifactId>maven-plugin-annotations</artifactId>
    <version>3.5.2</version>
    <scope>provided</scope>
    </dependency>


    <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-core</artifactId>
    <version>3.5.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.maven.shared</groupId>
    <artifactId>maven-dependency-tree</artifactId>
    <version>3.0.1</version>
    </dependency>

    <dependency>
    <groupId>org.alfresco</groupId>
    <artifactId>alfresco-data-model</artifactId>
    <version>5.1.g</version>
    </dependency>

    <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-project</artifactId>
    <version>2.2.1</version>
    <scope>provided</scope>
    </dependency>

    <dependency>
    <groupId>com.squareup</groupId>
    <artifactId>javapoet</artifactId>
    <version>1.11.1</version>
    </dependency>



    <dependency>
    <artifactId>junit</artifactId>
    <groupId>junit</groupId>
    <version>4.11</version>
    <scope>test</scope>
    </dependency>
    </dependencies>

    <build>
    <plugins>
    <plugin>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.9</version>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-plugin-plugin</artifactId>
    <version>3.5.2</version>
    <executions>
    <execution>
    <id>default-descriptor</id>
    <phase>process-classes</phase>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>






    EDIT: I tried adding



        <dependency>
    <groupId>org.sonatype.aether</groupId>
    <artifactId>aether-api</artifactId>
    <version>1.8</version>
    </dependency>
    <dependency>
    <groupId>org.sonatype.aether</groupId>
    <artifactId>aether-util</artifactId>
    <version>1.8</version>
    </dependency>


    But the problem persists. I tried adding it to both projects as well. Same result.










    share|improve this question



























      0












      0








      0








      I am writing what is essentially my first maven plugin, so this might just be a lack of google skills, but here goes.



      I am using the maven-plugin-plugin to create a plugin



              <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-plugin-plugin</artifactId>
      <version>3.5.2</version>
      <executions>
      <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
      </execution>
      </executions>
      </plugin>


      I am using maven version 3.5.2.



      The plugin project builds fine, but when I try to use it in another project it fails with this error:



      Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.graph.Dependency
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
      ....(Lots of google.inject stuff)....
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)


      After some googeling I found this stackoverflow post which I don't fully understand, but I did look at the bugreport and changed my Dependency plugin version (in both the plugin project and the consumer project because I have no idea what I'm doing :) )



      The error is still there in unchanged form. The error is happening in the generatesources phase which is where my plugin is running, and removing the plugin makes the error disappear, so I am fairly certain that my plugin is to blame.



      Can someone explain in simple terms what is happening, and help me with a solution? Thank you much in advance.



      Here is the entire plugin POM



      <project>
      <modelVersion>4.0.0</modelVersion>

      <groupId>...</groupId>
      <artifactId>...</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>maven-plugin</packaging>

      <name>...</name>

      <properties>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      </properties>



      <dependencies>
      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.5.2</version>
      </dependency>

      <!-- dependencies to annotations -->
      <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5.2</version>
      <scope>provided</scope>
      </dependency>


      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.5.2</version>
      </dependency>
      <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-dependency-tree</artifactId>
      <version>3.0.1</version>
      </dependency>

      <dependency>
      <groupId>org.alfresco</groupId>
      <artifactId>alfresco-data-model</artifactId>
      <version>5.1.g</version>
      </dependency>

      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.2.1</version>
      <scope>provided</scope>
      </dependency>

      <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>javapoet</artifactId>
      <version>1.11.1</version>
      </dependency>



      <dependency>
      <artifactId>junit</artifactId>
      <groupId>junit</groupId>
      <version>4.11</version>
      <scope>test</scope>
      </dependency>
      </dependencies>

      <build>
      <plugins>
      <plugin>
      <artifactId>maven-dependency-plugin</artifactId>
      <version>2.9</version>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-plugin-plugin</artifactId>
      <version>3.5.2</version>
      <executions>
      <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>






      EDIT: I tried adding



          <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.8</version>
      </dependency>
      <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-util</artifactId>
      <version>1.8</version>
      </dependency>


      But the problem persists. I tried adding it to both projects as well. Same result.










      share|improve this question
















      I am writing what is essentially my first maven plugin, so this might just be a lack of google skills, but here goes.



      I am using the maven-plugin-plugin to create a plugin



              <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-plugin-plugin</artifactId>
      <version>3.5.2</version>
      <executions>
      <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
      </execution>
      </executions>
      </plugin>


      I am using maven version 3.5.2.



      The plugin project builds fine, but when I try to use it in another project it fails with this error:



      Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.graph.Dependency
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
      ....(Lots of google.inject stuff)....
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)


      After some googeling I found this stackoverflow post which I don't fully understand, but I did look at the bugreport and changed my Dependency plugin version (in both the plugin project and the consumer project because I have no idea what I'm doing :) )



      The error is still there in unchanged form. The error is happening in the generatesources phase which is where my plugin is running, and removing the plugin makes the error disappear, so I am fairly certain that my plugin is to blame.



      Can someone explain in simple terms what is happening, and help me with a solution? Thank you much in advance.



      Here is the entire plugin POM



      <project>
      <modelVersion>4.0.0</modelVersion>

      <groupId>...</groupId>
      <artifactId>...</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>maven-plugin</packaging>

      <name>...</name>

      <properties>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      </properties>



      <dependencies>
      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.5.2</version>
      </dependency>

      <!-- dependencies to annotations -->
      <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5.2</version>
      <scope>provided</scope>
      </dependency>


      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.5.2</version>
      </dependency>
      <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-dependency-tree</artifactId>
      <version>3.0.1</version>
      </dependency>

      <dependency>
      <groupId>org.alfresco</groupId>
      <artifactId>alfresco-data-model</artifactId>
      <version>5.1.g</version>
      </dependency>

      <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.2.1</version>
      <scope>provided</scope>
      </dependency>

      <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>javapoet</artifactId>
      <version>1.11.1</version>
      </dependency>



      <dependency>
      <artifactId>junit</artifactId>
      <groupId>junit</groupId>
      <version>4.11</version>
      <scope>test</scope>
      </dependency>
      </dependencies>

      <build>
      <plugins>
      <plugin>
      <artifactId>maven-dependency-plugin</artifactId>
      <version>2.9</version>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-plugin-plugin</artifactId>
      <version>3.5.2</version>
      <executions>
      <execution>
      <id>default-descriptor</id>
      <phase>process-classes</phase>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>






      EDIT: I tried adding



          <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.8</version>
      </dependency>
      <dependency>
      <groupId>org.sonatype.aether</groupId>
      <artifactId>aether-util</artifactId>
      <version>1.8</version>
      </dependency>


      But the problem persists. I tried adding it to both projects as well. Same result.







      java maven maven-plugin aether






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 28 '18 at 11:31







      Martin Nielsen

















      asked Nov 28 '18 at 10:26









      Martin NielsenMartin Nielsen

      75351738




      75351738
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You shoud add the aether api dependency to your plugin pom:



             <dependency>
          <groupId>org.sonatype.aether</groupId>
          <artifactId>aether-api</artifactId>
          </dependency>





          share|improve this answer
























          • I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

            – Martin Nielsen
            Nov 28 '18 at 11:32











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53517244%2fcustom-maven-plugin-execution-fails-with-classnotfound%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You shoud add the aether api dependency to your plugin pom:



             <dependency>
          <groupId>org.sonatype.aether</groupId>
          <artifactId>aether-api</artifactId>
          </dependency>





          share|improve this answer
























          • I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

            – Martin Nielsen
            Nov 28 '18 at 11:32
















          0














          You shoud add the aether api dependency to your plugin pom:



             <dependency>
          <groupId>org.sonatype.aether</groupId>
          <artifactId>aether-api</artifactId>
          </dependency>





          share|improve this answer
























          • I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

            – Martin Nielsen
            Nov 28 '18 at 11:32














          0












          0








          0







          You shoud add the aether api dependency to your plugin pom:



             <dependency>
          <groupId>org.sonatype.aether</groupId>
          <artifactId>aether-api</artifactId>
          </dependency>





          share|improve this answer













          You shoud add the aether api dependency to your plugin pom:



             <dependency>
          <groupId>org.sonatype.aether</groupId>
          <artifactId>aether-api</artifactId>
          </dependency>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 '18 at 11:14









          hasnaehasnae

          1,2731016




          1,2731016













          • I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

            – Martin Nielsen
            Nov 28 '18 at 11:32



















          • I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

            – Martin Nielsen
            Nov 28 '18 at 11:32

















          I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

          – Martin Nielsen
          Nov 28 '18 at 11:32





          I added aether-api to both projects. It made no difference. The dependency actually seems to be in the graph regardless.

          – Martin Nielsen
          Nov 28 '18 at 11:32




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53517244%2fcustom-maven-plugin-execution-fails-with-classnotfound%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks