Date: Mon, 15 Sep 2014 19:06:56 +0530
Subject: Classpath issue in custom maven plugin
From: [email protected]
To: [email protected]
CC: [email protected]
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>
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: [email protected]
For additional commands, e-mail: [email protected]