Getting Started with Maven + Jaxb project + IntellijIdea

Posted by Em Ae on Stack Overflow See other posts from Stack Overflow or by Em Ae
Published on 2012-09-26T15:08:07Z Indexed on 2012/09/27 3:37 UTC
Read the original article Hit count: 265

I am complete new to IntellijIdea and i am looking for some step-by-step process to set up a basic project.

My project depends on Maven + Jaxb classes so i need a Maven project so that when i compile this project, the JAXB Objects are generated by Maven plugins. Now i started like this

  1. I created a blank project say MaJa project
  2. Added Maven Module to it
  3. Added following settings in POM.XML
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
          http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>MaJa</groupId>
    <artifactId>MaJa</artifactId>
    <version>1.0</version>

    <dependencies>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>${basedir}/src/main/resource/api/MaJa</schemaDirectory>
                    <packageName>com.rimt.shopping.api.web.ws.v1.model</packageName>
                    <outputDirectory>${build.directory}</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
  1. First of all, is it right settings ?

  2. I tried clicking on Make/Compile 'MaJa' from Project > Right Click Menu and it didn't do anything.

I will be looking forward to yoru replies.

© Stack Overflow or respective owner

Related posts about maven

Related posts about jaxb