RE: Classpath issue in custom maven plugin

2014-09-16 Thread Martin Gainty
   

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:
MGas 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('.', 
'/');EnumerationURL 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  groupIdcom.thed/groupId  
artifactIdapi-docs/artifactId  version1.0-SNAPSHOT/version  
configuration
packageNamecom.thed.service.rest.resource/packageName 
vmFileapiary.vm/vmFile
outputFileName${basedir}/target/apiary.apib/outputFileName
/configuration executions   execution 
phaseprepare-package/phase  goals 
goalgenerateApiDocs/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   
groupIdcom.github.kongchen/groupId   
artifactIdswagger-maven-plugin/artifactId   version1.0-SNAPSHOT/version 
   configurationapiSources   apiSource
apiPackagecom.thed.service.rest.resource/apiPackage 
apiVersionv1/apiVersion 
basePathhttp://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/configurationexecutions   
execution  phaseprepare-package/phase   
goals  goalgenerate/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
  

Re: Classpath issue in custom maven plugin

2014-09-15 Thread shailesh mangal
Limitation perhaps comes from OSGi where each bundle has its own class
loader. Did u try to run it from command line?
On Sep 15, 2014 6:36 AM, Kavita Gupta kavita.gpt1...@gmail.com wrote:


 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('.', '/');

 EnumerationURL 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

   groupIdcom.thed/groupId

   artifactIdapi-docs/artifactId

   version1.0-SNAPSHOT/version

   configuration

 packageNamecom.thed.service.rest.resource/packageName

 vmFileapiary.vm/vmFile


 outputFileName${basedir}/target/apiary.apib/outputFileName

   /configuration

  executions

 execution

 phaseprepare-package/phase

 goals

 goalgenerateApiDocs/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

groupIdcom.github.kongchen/groupId

artifactIdswagger-maven-plugin/artifactId

version1.0-SNAPSHOT/version

 configuration

 apiSources

 apiSource

apiPackagecom.thed.service.rest.resource/apiPackage

apiVersionv1/apiVersion

basePathhttp://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

phaseprepare-package/phase

 goals

  goalgenerate/goal

  /goals

 /execution

   /executions

 /plugin


 Please provide me the input to solve this classpath issue.
 ​

 --
 Thanks,
 Kavita Gupta Agarwal



RE: Classpath issue in custom maven plugin

2014-09-15 Thread Martin Gainty

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
ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
System.out.println(classLoader.getResources(com/abc/service/rest/resource));  
  assert classLoader != null;String path = packageName.replace('.', 
'/');EnumerationURL 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  groupIdcom.thed/groupId  
artifactIdapi-docs/artifactId  version1.0-SNAPSHOT/version  
configuration
packageNamecom.thed.service.rest.resource/packageName 
vmFileapiary.vm/vmFile
outputFileName${basedir}/target/apiary.apib/outputFileName
/configuration executions   execution 
phaseprepare-package/phase  goals 
goalgenerateApiDocs/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   
groupIdcom.github.kongchen/groupId   
artifactIdswagger-maven-plugin/artifactId   version1.0-SNAPSHOT/version 
   configurationapiSources   apiSource
apiPackagecom.thed.service.rest.resource/apiPackage 
apiVersionv1/apiVersion 
basePathhttp://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/configurationexecutions   
execution  phaseprepare-package/phase   
goals  goalgenerate/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