If you are interested in the latest features of MyBatis Generator and are tired to wait for the release of next version (the current version is 1.3.2, published July 2012), you can use the last snapshot. Here’s how with Maven 3.

Add the Sonatype snapshot repository to your pom.xml (found at http://mybatis.github.io/generator/distribution-management.html):


<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<name>MyBatis Snapshot Repo</name>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Change the artifact version to 1.3.3-SNAPSHOT, for example:


<build>

<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.3-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${postgresql.group}</groupId>
<artifactId>${postgresql.artifact}</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>

</build>

If you, like me, are still experiencing troubles compiling the project, then try to manualy download the artifacts:


mvn dependency:get -Dartifact=org.mybatis.generator:mybatis-generator-core:1.3.3-SNAPSHOT

mvn dependency:get -Dartifact=org.mybatis.generator:mybatis-generator-maven-plugin:1.3.3-SNAPSHOT

This solved my issue, a problem with the configuration of network/proxy, resolved at a later moment.

PS: I’m interested in MBG 1.3.3 because fixes a bug I reported in 2012 (when the project was hosted by Google Code): when a table as a timestamp column as primary key, the generated java file misses the “import java.util.Date;” line.

Annunci