From: mgai...@hotmail.com
To: users@maven.apache.org
Subject: RE: Classpath issue in custom maven plugin
Date: Mon, 15 Sep 2014 18:49:41 -0400





Date: Mon, 15 Sep 2014 19:06:56 +0530
Subject: Classpath issue in custom maven plugin
From: kavita.gpt1...@gmail.com
To: users@maven.apache.org
CC: shailesh.man...@gmail.com

Hi!
I have created my own custom maven plugin(api-docs) for developing apiary 
blueprint. While triggering my custom plugin using m2Eclipse I am getting a 
classpath issue that classPath.getresources is fetching resources from plexus 
jar, while when I debug the swagger plugin (which I am taking as a reference) 
it is picking up the resources from rt.jar. In swagger I am getting 
web/target/classes in URLS but in my custom project I am not getting the  
web/target/classes in URLS. Code snippet is:
MG>as previously mentioned...
If the tests pass on command line with maven 3.0.2 or newer but fail from m2e, 
please open a
bugreport in https://bugs.eclipse.org/bugs/enter_bug.cgi?product=m2e

Make sure to attach complete standalone example project and steps to reproduce 
the problem.

https://docs.sonatype.org/display/M2ECLIPSE/Runtime+classpath
MG>

        ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();        
System.out.println(classLoader.getResources("com/abc/service/rest/resource"));  
      assert classLoader != null;        String path = packageName.replace('.', 
'/');        Enumeration<URL> resources = classLoader.getResources(path);
My custom plugin's dependency tree is attached(apidocsTree.txt). I have 
integrated it in my other project i.e web. Here is the web pom configuration 
for the plugin.
<plugin>          <groupId>com.thed</groupId>          
<artifactId>api-docs</artifactId>          <version>1.0-SNAPSHOT</version>      
    <configuration>                                                    
<packageName>com.thed.service.rest.resource</packageName>                 
<vmFile>apiary.vm</vmFile>                
<outputFileName>${basedir}/target/apiary.apib</outputFileName>        
</configuration>         <executions>                   <execution>             
            <phase>prepare-package</phase>                          <goals>     
                        <goal>generateApiDocs</goal>                        
</goals>                    </execution>    </executions>                       
     </plugin>

I am taking swagger-plugin as a reference. Its dependency tree is attached as 
swaggerTree.txt. Its configuration in web is:<plugin>   
<groupId>com.github.kongchen</groupId>   
<artifactId>swagger-maven-plugin</artifactId>   <version>1.0-SNAPSHOT</version> 
   <configuration>        <apiSources>           <apiSource>                    
<apiPackage>com.thed.service.rest.resource</apiPackage>                 
<apiVersion>v1</apiVersion>                     
<basePath>http://localhost:8080/flex/services/rest/latest</basePath>            
        
<outputTemplate>${basedir}/src/site/docs/template/rest/zephyr_html.mustache</outputTemplate>
                    
<outputPath>${basedir}/src/main/webapp/data/rest-doc.html</outputPath>          
 </apiSource>      </apiSources>    </configuration>    <executions>       
<execution>              <phase>prepare-package</phase>                   
<goals>                      <goal>generate</goal>               </goals>       
</execution>    </executions></plugin>
Please provide me the input to solve this classpath issue.​

-- 
Thanks, Kavita Gupta Agarwal


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org                    
                                                          

Reply via email to