5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-02 19:50:39 +08:00

SQOOP-392. Build using maven is broken due to missing class generated by script write-version-info.sh

(Arvind Prabhakar via Jarek Jarcec Cecho)



git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1206698 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jarek Jarcec Cecho 2011-11-27 11:12:37 +00:00
parent 1bf7cbf81a
commit 9bde3ec5df
2 changed files with 54 additions and 2 deletions

52
pom.xml
View File

@ -261,10 +261,21 @@ limitations under the License.
</dependencies>
<build>
<scriptSourceDirectory>src/scripts</scriptSourceDirectory>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
@ -298,6 +309,47 @@ limitations under the License.
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-version-tool</id>
<phase>generate-sources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
<echo>Generating version tool</echo>
<mkdir dir="${basedir}/target/generated-sources"/>
<exec executable="${basedir}/src/scripts/write-version-info.sh"
dir="${basedir}" failonerror="true">
<arg value="${basedir}/target/generated-sources"/>
<arg value="${version}" />
<arg value="${gitHash}" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-generated-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -37,7 +37,6 @@
import com.cloudera.sqoop.config.ConfigurationHelper;
import com.cloudera.sqoop.mapreduce.db.DBConfiguration;
import com.cloudera.sqoop.mapreduce.db.DBOutputFormat.DBRecordWriter;
/**
* A OutputFormat that sends the reduce output to a SQL table.
@ -119,7 +118,8 @@ public RecordWriter<K, V> getRecordWriter(TaskAttemptContext context)
statement = connection.prepareStatement(
constructQuery(tableName, fieldNames));
return new DBRecordWriter(connection, statement);
return new com.cloudera.sqoop.mapreduce.db.DBOutputFormat.DBRecordWriter(
connection, statement);
} catch (Exception ex) {
throw new IOException(ex);
}