sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1206698 - in /incubator/sqoop/trunk: pom.xml src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java
Date Sun, 27 Nov 2011 11:12:37 GMT
Author: jarcec
Date: Sun Nov 27 11:12:37 2011
New Revision: 1206698

URL: http://svn.apache.org/viewvc?rev=1206698&view=rev
Log:
SQOOP-392. Build using maven is broken due to missing class generated by script write-version-info.sh

(Arvind Prabhakar via Jarek Jarcec Cecho)


Modified:
    incubator/sqoop/trunk/pom.xml
    incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java

Modified: incubator/sqoop/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/pom.xml?rev=1206698&r1=1206697&r2=1206698&view=diff
==============================================================================
--- incubator/sqoop/trunk/pom.xml (original)
+++ incubator/sqoop/trunk/pom.xml Sun Nov 27 11:12:37 2011
@@ -261,12 +261,23 @@ 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>
           <version>2.4.1</version>
         </plugin>
@@ -300,6 +311,47 @@ limitations under the License.
     <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>
         <configuration>
           <systemPropertyVariables>

Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java?rev=1206698&r1=1206697&r2=1206698&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java Sun Nov
27 11:12:37 2011
@@ -37,7 +37,6 @@ import org.apache.hadoop.util.StringUtil
 
 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 class DBOutputFormat<K extends DB
 
       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);
     }



Mime
View raw message