users@jaxb.java.net

Re: maven-jaxb-plugin and xjc plugins

From: Vivian Steller <vivian.steller_at_uni-ulm.de>
Date: Tue, 5 Jun 2007 11:17:04 +0200

Thanks lexi,
but unfortunately it did not work.

I'm using Maven2 and JAXB2. Maybe it is related to xjc version 2.x?

For completeness here's the code of my plugin:

public class ShaleBeanPlugin extends Plugin {

        public static final String NS = "http://ns.eecoo.net/jaxb/plugin/
shale-bean";

        @Override
        public String getOptionName() {
                return "XShaleBean";
        }

        @Override
        public String getUsage() {
                return "-XShaleBean : Generates shale.apache.org Tiger
Extension Bean Annotations";
        }

        @Override
        public boolean run(Outline model, Options opt, ErrorHandler
errorHandler) {
                ...
        }

        ...
     @Override
     public List<String> getCustomizationURIs() {
         return Collections.singletonList(ShaleBeanPlugin.NS);
     }

     @Override
     public boolean isCustomizationTagName(String nsUri, String
localName) {
         return nsUri.equals(ShaleBeanPlugin.NS) && localName.equals
("name") ||
                         nsUri.equals(ShaleBeanPlugin.NS) && localName.equals
("scope");
     }
}

Thanks for any further hints.

Kind regards,
-vivian

Am 05.06.2007 um 02:29 schrieb Aleksei Valikov:

> Hi.
>
>
> I've coded my first XJC plugin but have the problem that the maven-
> jaxb-plugin seems not to recognize the plugin.
>
> Use dependencies/dependency inside of the <plugin.../> to add
> dependencies to the plugin.
> See also this Maven plugin:
> https://maven-jaxb1-plugin.dev.java.net/
>
> Here's an example:
>
> <build>
> <defaultGoal>install</defaultGoal>
> <plugins>
> <plugin>
> <groupId> org.jvnet.jaxb1.maven2</groupId>
> <artifactId>maven-jaxb1-plugin</artifactId>
> <dependencies>
> <dependency>
> <groupId> org.jvnet.jaxbvalidation</groupId>
> <artifactId>jaxbvalidation-core</artifactId>
> <version>1.0.5</version>
> </dependency>
> </dependencies>
> <executions>
> <execution>
> <goals>
> <goal>generate</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <args>
> <arg>-Xjaxbvalidation</arg>
> </args>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> I think the same should work with the other plugin as well.
>
> Bye.
> /lexi
>
>