aspose file tools*
The moose likes XML and Related Technologies and the fly likes Trying to generate jaxb files from remote repository of schema using maven jaxb plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Trying to generate jaxb files from remote repository of schema using maven jaxb plugin" Watch "Trying to generate jaxb files from remote repository of schema using maven jaxb plugin" New topic
Author

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

Gourav Gupta
Greenhorn

Joined: Dec 27, 2013
Posts: 19
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

Joined: Sep 26, 2006
Posts: 9524
    
    2

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!


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Gourav Gupta
Greenhorn

Joined: Dec 27, 2013
Posts: 19
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

Joined: Jan 18, 2011
Posts: 544
    
    3
This is the section you should start with.
http://confluence.highsource.org/display/MJIIP/User+Guide#UserGuide-Resourceentries
Gourav Gupta
Greenhorn

Joined: Dec 27, 2013
Posts: 19
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to generate jaxb files from remote repository of schema using maven jaxb plugin