• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to generate jaxb files from remote repository of schema using maven jaxb plugin

 
Gourav Gupta
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am facing one issue where my requirement is that I need to generate jaxb files from schema using maven jaxb plugin. When I have the schema on my local repository (Like <schemaDirectory>src/main/resources/xxx</schemaDirectory>) then below code works fine but my schema is on remote location (Like <schemaDirectory>https://dev01.svn.com:8443/svn/YYY</schemaDirectory>) and when I tried same code with SchemaDirectory value is remote path, it doesn't work. Any Idea. Please advice.

<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.5-01</version>
<executions>
<execution>
<id>appId</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<args>
<param>-npa</param>
</args>
<schemaDirectory>src/main/resources/xxx</schemaDirectory>
<schemaIncludes>
<include>**/*.xsd</include>
</schemaIncludes>
<generateDirectory>src/main/java</generateDirectory>
<generatePackage>com.app.jaxb</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot specify a http call against a schema directory xml element. One possibility is to have the schema located on a remote file system and specify the part of that remote file system in you maven pom.xml. Hope this helps!
 
Gourav Gupta
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Herry, I tried the below code as well but also it did not work. Can you please give me the example of your words?
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.5-01</version>
<executions>
<execution>
<id>appId</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<args>
<param>-npa</param>
</args>
<uriSchemas>
<uriSchema>https://dev01.svn.com:8443/svn/YYY/dummy.xsd</uriSchema>
</uriSchemas>
<generateDirectory>src/main/java</generateDirectory>
<generatePackage>com.app.jaxb</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
 
g tsuji
Ranch Hand
Posts: 669
3
 
Gourav Gupta
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much tsuji. It worked and helped me to resolve the issue. I tried below code and it worked fine.

<execution>
<id>appId</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<forceRegenerate>true</forceRegenerate>
<schemas>
<schema>
<url>http://abc.com/user/dummy.xsd</url>
</schema>
</schemas>
<generateDirectory>src/main/java</generateDirectory>
<generatePackage>com.test.jaxb</generatePackage>
</configuration>
</execution>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic