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:
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
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building api-docs Maven Plugin 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ api-docs --- [INFO] com.thed:api-docs:maven-plugin:1.0-SNAPSHOT [INFO] +- org.apache.maven:maven-artifact:jar:2.2.1:compile [INFO] | \- org.codehaus.plexus:plexus-utils:jar:1.5.15:compile [INFO] +- org.apache.maven:maven-plugin-api:jar:2.2.1:compile [INFO] +- org.apache.maven:maven-project:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-settings:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-profile:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-artifact-manager:jar:2.2.1:compile [INFO] | | \- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile [INFO] | +- org.apache.maven:maven-plugin-registry:jar:2.2.1:compile [INFO] | +- org.codehaus.plexus:plexus-interpolation:jar:1.11:compile [INFO] | \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile [INFO] +- org.apache.maven:maven-model:jar:2.2.1:compile [INFO] +- org.apache.maven:maven-core:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2:runtime [INFO] | | \- slide:slide-webdavlib:jar:2.1:runtime [INFO] | | +- commons-httpclient:commons-httpclient:jar:2.0.2:runtime [INFO] | | +- jdom:jdom:jar:1.0:runtime [INFO] | | \- de.zeigermann.xml:xml-im-exporter:jar:1.1:runtime [INFO] | +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2:runtime [INFO] | | \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2:runtime [INFO] | | \- jtidy:jtidy:jar:4aug2000r7-dev:runtime [INFO] | +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile [INFO] | | \- org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-10:compile [INFO] | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile [INFO] | +- org.apache.maven:maven-repository-metadata:jar:2.0.9:compile [INFO] | +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile [INFO] | +- commons-cli:commons-cli:jar:1.0:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-2:runtime [INFO] | | \- org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile [INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile [INFO] | +- org.apache.maven:maven-monitor:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-2:runtime [INFO] | | \- com.jcraft:jsch:jar:0.1.27:runtime [INFO] | \- classworlds:classworlds:jar:1.1:compile [INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.2:compile [INFO] | +- org.apache.httpcomponents:httpcore:jar:4.2.2:compile [INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | \- commons-codec:commons-codec:jar:1.6:compile [INFO] +- org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.3:provided [INFO] +- junit:junit:jar:4.10:test (scope not updated to compile) [INFO] +- org.reflections:reflections:jar:0.9.8:compile [INFO] | +- com.google.guava:guava:jar:11.0.2:compile [INFO] | | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile [INFO] | +- javassist:javassist:jar:3.12.1.GA:compile [INFO] | \- dom4j:dom4j:jar:1.6.1:compile [INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile [INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile [INFO] +- com.wordnik:swagger-annotations_2.9.1:jar:1.2.1:compile [INFO] +- org.apache.velocity:velocity:jar:1.7:compile [INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile [INFO] | \- commons-lang:commons-lang:jar:2.4:compile [INFO] +- com.wordnik:swagger-jaxrs_2.9.1:jar:1.2.3:compile [INFO] | +- org.scala-lang:scala-library:jar:2.9.1-1:compile [INFO] | +- com.wordnik:swagger-core_2.9.1:jar:1.2.3:compile [INFO] | | +- org.slf4j:slf4j-api:jar:1.6.3:compile [INFO] | | +- com.fasterxml.jackson.module:jackson-module-scala_2.9.1:jar:2.1.3:compile [INFO] | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile [INFO] | | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile [INFO] | | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.4:compile [INFO] | | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.0.0:compile [INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.0.0:compile [INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile [INFO] | +- com.sun.jersey:jersey-servlet:jar:1.13:compile [INFO] | +- com.sun.jersey:jersey-client:jar:1.13:compile [INFO] | +- com.sun.jersey:jersey-core:jar:1.13:compile [INFO] | \- com.sun.jersey:jersey-server:jar:1.13:compile [INFO] | \- asm:asm:jar:3.1:compile [INFO] +- log4j:log4j:jar:1.2.16:compile [INFO] \- org.springframework:spring-context:jar:3.0.2.RELEASE:compile [INFO] +- org.springframework:spring-aop:jar:3.0.2.RELEASE:compile [INFO] | \- aopalliance:aopalliance:jar:1.0:compile [INFO] +- org.springframework:spring-beans:jar:3.0.2.RELEASE:compile [INFO] +- org.springframework:spring-core:jar:3.0.2.RELEASE:compile [INFO] +- org.springframework:spring-expression:jar:3.0.2.RELEASE:compile [INFO] \- org.springframework:spring-asm:jar:3.0.2.RELEASE:compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.540s [INFO] Finished at: Mon Sep 15 17:57:49 IST 2014 [INFO] Final Memory: 10M/197M [INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.github.kongchen:swagger-maven-plugin:maven-plugin:1.0-SNAPSHOT [WARNING] 'parent.relativePath' points at com.thed:dtr instead of org.sonatype.oss:oss-parent, please verify your project structure @ line 3, column 13 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Swagger Maven Plugin 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ swagger-maven-plugin --- [INFO] com.github.kongchen:swagger-maven-plugin:maven-plugin:1.0-SNAPSHOT [INFO] +- org.apache.maven:maven-artifact:jar:2.2.1:compile [INFO] | \- org.codehaus.plexus:plexus-utils:jar:1.5.15:compile [INFO] +- org.apache.maven:maven-plugin-api:jar:2.2.1:compile [INFO] +- org.apache.maven:maven-project:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-settings:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-profile:jar:2.2.1:compile [INFO] | +- org.apache.maven:maven-artifact-manager:jar:2.2.1:compile [INFO] | | \- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile [INFO] | +- org.apache.maven:maven-plugin-registry:jar:2.2.1:compile [INFO] | +- org.codehaus.plexus:plexus-interpolation:jar:1.11:compile [INFO] | \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile [INFO] | \- junit:junit:jar:3.8.1:compile [INFO] +- org.apache.maven:maven-model:jar:2.2.1:compile [INFO] +- org.apache.maven:maven-core:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2:runtime [INFO] | | \- slide:slide-webdavlib:jar:2.1:runtime [INFO] | | +- commons-httpclient:commons-httpclient:jar:2.0.2:runtime [INFO] | | +- jdom:jdom:jar:1.0:runtime [INFO] | | \- de.zeigermann.xml:xml-im-exporter:jar:1.1:runtime [INFO] | +- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-2:runtime [INFO] | | +- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-2:runtime [INFO] | | | \- jtidy:jtidy:jar:4aug2000r7-dev:runtime [INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:runtime [INFO] | +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile [INFO] | | \- org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-10:compile [INFO] | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile [INFO] | +- org.apache.maven:maven-repository-metadata:jar:2.0.9:compile [INFO] | +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile [INFO] | +- commons-cli:commons-cli:jar:1.0:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh-external:jar:1.0-beta-2:runtime [INFO] | | \- org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-2:runtime [INFO] | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile [INFO] | +- org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile [INFO] | +- org.apache.maven:maven-monitor:jar:2.0.9:compile [INFO] | +- org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-2:runtime [INFO] | | \- com.jcraft:jsch:jar:0.1.27:runtime [INFO] | \- classworlds:classworlds:jar:1.1:compile [INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.2:compile [INFO] | +- org.apache.httpcomponents:httpcore:jar:4.2.2:compile [INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | \- commons-codec:commons-codec:jar:1.6:compile [INFO] +- com.github.spullara.mustache.java:compiler:jar:0.8.9:compile [INFO] | \- com.google.guava:guava:jar:12.0:compile [INFO] | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile [INFO] +- com.wordnik:swagger-jaxrs_2.9.1:jar:1.2.3:compile [INFO] | +- org.scala-lang:scala-library:jar:2.9.1-1:compile [INFO] | +- com.wordnik:swagger-core_2.9.1:jar:1.2.3:compile [INFO] | | +- commons-lang:commons-lang:jar:2.4:compile [INFO] | | +- org.slf4j:slf4j-api:jar:1.6.3:compile [INFO] | | +- com.fasterxml.jackson.module:jackson-module-scala_2.9.1:jar:2.1.3:compile [INFO] | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile [INFO] | | | \- com.thoughtworks.paranamer:paranamer:jar:2.3:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.4:compile [INFO] | | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.0.0:compile [INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.0.0:compile [INFO] | +- com.wordnik:swagger-annotations_2.9.1:jar:1.2.3:compile [INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile [INFO] | +- com.sun.jersey:jersey-servlet:jar:1.13:compile [INFO] | +- com.sun.jersey:jersey-client:jar:1.13:compile [INFO] | +- com.sun.jersey:jersey-core:jar:1.13:compile [INFO] | \- com.sun.jersey:jersey-server:jar:1.13:compile [INFO] | \- asm:asm:jar:3.1:compile [INFO] +- com.wordnik:swagger-codegen_2.9.1:jar:2.0.1:compile [INFO] | +- commons-io:commons-io:jar:2.3:compile [INFO] | +- org.fusesource.scalate:scalate-wikitext:jar:1.5.3:compile [INFO] | | +- org.fusesource.scalate:scalate-core:jar:1.5.3:compile [INFO] | | | +- org.fusesource.scalate:scalate-util:jar:1.5.3:compile [INFO] | | | \- org.scala-lang:scala-compiler:jar:2.9.1:compile [INFO] | | +- org.fusesource.wikitext:confluence-core:jar:1.2:compile [INFO] | | | \- org.fusesource.wikitext:wikitext-core:jar:1.2:compile [INFO] | | \- org.fusesource.wikitext:textile-core:jar:1.2:compile [INFO] | +- org.fusesource.scalate:scalate-page:jar:1.5.3:compile [INFO] | | +- rhino:js:jar:1.7R2:compile [INFO] | | +- org.yaml:snakeyaml:jar:1.7:compile [INFO] | | \- org.fusesource.scalamd:scalamd:jar:1.5:compile [INFO] | +- org.json4s:json4s-jackson_2.9.1:jar:3.0.0:compile [INFO] | | +- org.json4s:json4s-core_2.9.1:jar:3.0.0:compile [INFO] | | | +- org.scala-lang:scalap:jar:2.9.1:compile [INFO] | | | \- io.backchat.inflector:scala-inflector_2.9.1:jar:1.3.5:compile [INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.0.5:compile [INFO] | \- org.json4s:json4s-native_2.9.1:jar:3.0.0:compile [INFO] \- log4j:log4j:jar:1.2.16:compile [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.368s [INFO] Finished at: Mon Sep 15 17:58:22 IST 2014 [INFO] Final Memory: 10M/197M [INFO] ------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org