Review Board 1.7.22


SQOOP-514 Layout changes for Sqoop 2 distribution

Review Request #8029 - Created Nov. 13, 2012 and submitted

Jarek Cecho
SQOOP-514
Reviewers
Sqoop
sqoop-sqoop2
I've made two profiles for dist module - source and binary. Source will build pure source distribution and binary will build binary distribution. Binary distribution is source + same structure as today.

 

Diff revision 1 (Latest)

  1. dist/pom.xml: Loading...
dist/pom.xml
Revision ede3be7373c5f93cc721d301f0bc35ca55357c8f New Change
[20] 20 lines
[+20]
21

    
   
21

   
22
  <modelVersion>4.0.0</modelVersion>
22
  <modelVersion>4.0.0</modelVersion>
23

    
   
23

   
24
  <properties>
24
  <properties>
25
    <tomcat.majorVersion>6</tomcat.majorVersion>
25
    <tomcat.majorVersion>6</tomcat.majorVersion>
26
    <tomcat.minorVersion>0.35</tomcat.minorVersion>
26
    <tomcat.minorVersion>0.36</tomcat.minorVersion>
27
    <tomcat.version>${tomcat.majorVersion}.${tomcat.minorVersion}</tomcat.version>
27
    <tomcat.version>${tomcat.majorVersion}.${tomcat.minorVersion}</tomcat.version>
28
  </properties>
28
  </properties>
29

    
   
29

   
30

    
   
30

   
31
  <parent>
31
  <parent>
[+20] [20] 19 lines
[+20]
51
      <artifactId>sqoop-client</artifactId>
51
      <artifactId>sqoop-client</artifactId>
52
      <version>2.0.0-SNAPSHOT</version>
52
      <version>2.0.0-SNAPSHOT</version>
53
    </dependency>
53
    </dependency>
54
  </dependencies>
54
  </dependencies>
55

    
   
55

   

    
   
56
  <!--

    
   
57
  TODO(jarcec): Binary tarball should publish build documentation

    
   
58
  -->

    
   
59

   
56
  <profiles>
60
  <profiles>

    
   
61
    <!-- Build source distribution (activated by default) -->
57
    <profile>
62
    <profile>
58
      <id>dist</id>
63
      <id>source</id>
59
      <activation>
64
      <activation>
60
        <activeByDefault>true</activeByDefault>
65
        <activeByDefault>true</activeByDefault>
61
      </activation>
66
      </activation>
62
      <build>
67
      <build>
63
        <plugins>
68
        <plugins>
[+20] [20] 6 lines
[+20]
70
                <goals>
75
                <goals>
71
                  <goal>run</goal>
76
                  <goal>run</goal>
72
                </goals>
77
                </goals>
73
                <configuration>
78
                <configuration>
74
                  <target>
79
                  <target>
75
                    <!-- clean up -->
80
                    <!-- Clean up -->
76
                    <delete dir="target/sqoop-${project.version}"/>
81
                    <delete dir="target/sqoop-${project.version}"/>
77
                    <delete file="target/sqoop-${project.version}.tar.gz"/>
82
                    <delete file="target/sqoop-${project.version}.tar.gz"/>
78
                    <!-- create dist dir -->
83

   

    
   
84
                    <!-- Copy sources over -->

    
   
85
                    <copy todir="target/sqoop-${project.version}" includeEmptyDirs="false" flatten="false">

    
   
86
                      <fileset dir="../">

    
   
87
                        <include name="**/*" />

    
   
88
                        <exclude name="build/**" />

    
   
89
                        <exclude name="**/target/**" />

    
   
90
                        <exclude name=".git/**" />

    
   
91
                        <exclude name="tags" />

    
   
92
                        <exclude name=".project" />

    
   
93
                        <exclude name=".classpath" />

    
   
94
                      </fileset>

    
   
95
                    </copy>

    
   
96

   

    
   
97
                    <!-- Create dist dir -->
79
                    <mkdir dir="target/sqoop-${project.version}"/>
98
                    <mkdir dir="target/sqoop-${project.version}"/>
80

    
   
99

   
81
                    <!-- server -->
100
                    <!-- Create final distribution tar -->

    
   
101
                    <tar destfile="target/sqoop-${project.version}.tar.gz" compression="gzip">

    
   
102
                      <tarfileset dir="target/sqoop-${project.version}" prefix="sqoop-${project.version}"/>

    
   
103
                    </tar>

    
   
104
                  </target>

    
   
105
                </configuration>

    
   
106
              </execution>

    
   
107
            </executions>

    
   
108
          </plugin>

    
   
109
        </plugins>

    
   
110
      </build>

    
   
111
    </profile>

    
   
112

   

    
   
113
    <!-- Build binary distribution (activated by -Pbinary) -->

    
   
114
    <profile>

    
   
115
      <id>binary</id>

    
   
116
      <build>

    
   
117
        <plugins>

    
   
118
          <plugin>

    
   
119
            <groupId>org.apache.maven.plugins</groupId>

    
   
120
            <artifactId>maven-antrun-plugin</artifactId>

    
   
121
            <executions>

    
   
122
              <execution>

    
   
123
                <phase>package</phase>

    
   
124
                <goals>

    
   
125
                  <goal>run</goal>

    
   
126
                </goals>

    
   
127
                <configuration>

    
   
128
                  <target>

    
   
129
                    <!-- Clean up -->

    
   
130
                    <delete dir="target/sqoop-${project.version}-bin"/>

    
   
131
                    <delete file="target/sqoop-${project.version}-bin.tar.gz"/>

    
   
132

   

    
   
133
                    <!-- Create dist dir -->

    
   
134
                    <mkdir dir="target/sqoop-${project.version}-bin"/>

    
   
135

   

    
   
136

   

    
   
137
                    <!-- Copy sources over -->

    
   
138
                    <copy todir="target/sqoop-${project.version}-bin" includeEmptyDirs="false" flatten="false">

    
   
139
                      <fileset dir="../">

    
   
140
                        <include name="**/*" />

    
   
141
                        <exclude name="build/**" />

    
   
142
                        <exclude name="**/target/**" />

    
   
143
                        <exclude name=".git/**" />

    
   
144
                        <exclude name="tags" />

    
   
145
                        <exclude name=".project" />

    
   
146
                        <exclude name=".classpath" />

    
   
147
                      </fileset>

    
   
148
                    </copy>

    
   
149

   

    
   
150
                    <!-- Build server directory -->
82
                    <get src="http://archive.apache.org/dist/tomcat/tomcat-${tomcat.majorVersion}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz"
151
                    <get src="http://archive.apache.org/dist/tomcat/tomcat-${tomcat.majorVersion}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz"
83
                         dest="target/apache-tomcat.tar.gz" verbose="true" skipexisting="true"/>
152
                         dest="target/apache-tomcat.tar.gz" verbose="true" skipexisting="true"/>
84
                    <untar src="target/apache-tomcat.tar.gz" dest="target" compression="gzip"/>
153
                    <untar src="target/apache-tomcat.tar.gz" dest="target" compression="gzip"/>
85
                    <move file="target/apache-tomcat-${tomcat.version}" tofile="target/sqoop-${project.version}/server"/>
154
                    <move file="target/apache-tomcat-${tomcat.version}" tofile="target/sqoop-${project.version}-bin/server"/>
86
                    <copy todir="target/sqoop-${project.version}/server/bin">
155
                    <copy todir="target/sqoop-${project.version}-bin/server/bin">
87
                      <fileset dir="src/main/server/bin"/>
156
                      <fileset dir="src/main/server/bin"/>
88
                    </copy>
157
                    </copy>
89
                    <chmod dir="target/sqoop-${project.version}/server/bin" perm="u+x" includes="**/*.sh"/>
158
                    <chmod dir="target/sqoop-${project.version}-bin/server/bin" perm="u+x" includes="**/*.sh"/>
90
                    <copy todir="target/sqoop-${project.version}/server/conf">
159
                    <copy todir="target/sqoop-${project.version}-bin/server/conf">
91
                      <fileset dir="src/main/server/conf"/>
160
                      <fileset dir="src/main/server/conf"/>
92
                    </copy>
161
                    </copy>
93
                    <delete dir="target/sqoop-${project.version}/server/webapps"/>
162
                    <delete dir="target/sqoop-${project.version}-bin/server/webapps"/>
94
                    <mkdir dir="target/sqoop-${project.version}/server/webapps"/>
163
                    <mkdir dir="target/sqoop-${project.version}-bin/server/webapps"/>
95
                    <copy todir="target/sqoop-${project.version}/server/webapps">
164
                    <copy todir="target/sqoop-${project.version}-bin/server/webapps">
96
                      <fileset dir="src/main/server/webapps"/>
165
                      <fileset dir="src/main/server/webapps"/>
97
                    </copy>
166
                    </copy>
98
                    <copy file="../server/target/sqoop.war"
167
                    <copy file="../server/target/sqoop.war"
99
                          toDir="target/sqoop-${project.version}/server/webapps"/>
168
                          toDir="target/sqoop-${project.version}-bin/server/webapps"/>
100

    
   
169

   
101
                    <!-- client -->
170
                    <!-- Build client directory -->
102
                    <copy todir="target/sqoop-${project.version}/client/lib">
171
                    <copy todir="target/sqoop-${project.version}-bin/client/lib">
103
                      <fileset dir="../client/target/lib"/>
172
                      <fileset dir="../client/target/lib"/>
104
                    </copy>
173
                    </copy>
105
                    <copy file="../client/target/sqoop-client-${project.version}.jar"
174
                    <copy file="../client/target/sqoop-client-${project.version}.jar"
106
                          toDir="target/sqoop-${project.version}/client/lib"/>
175
                          toDir="target/sqoop-${project.version}-bin/client/lib"/>
107

    
   
176

   
108
                    <!-- binary -->
177
                    <!-- Build "bin" directory -->
109
                    <copy todir="target/sqoop-${project.version}/bin">
178
                    <copy todir="target/sqoop-${project.version}-bin/bin">
110
                      <fileset dir="src/main/bin"/>
179
                      <fileset dir="src/main/bin"/>
111
                    </copy>
180
                    </copy>
112
                    <chmod dir="target/sqoop-${project.version}/bin" perm="u+x" includes="**/*.sh"/>
181
                    <chmod dir="target/sqoop-${project.version}-bin/bin" perm="u+x" includes="**/*.sh"/>
113

    
   
182

   
114
                    <!-- create dist tar -->
183
                    <!-- Finally create distribution tar -->
115
                    <tar destfile="target/sqoop-${project.version}.tar.gz" compression="gzip">
184
                    <tar destfile="target/sqoop-${project.version}-bin.tar.gz" compression="gzip">
116
                      <tarfileset dir="target/sqoop-${project.version}" prefix="sqoop-${project.version}"/>
185
                      <tarfileset dir="target/sqoop-${project.version}-bin" prefix="sqoop-${project.version}"/>
117
                    </tar>
186
                    </tar>
118
                  </target>
187
                  </target>
119
                </configuration>
188
                </configuration>
120
              </execution>
189
              </execution>
121
            </executions>
190
            </executions>
122
          </plugin>
191
          </plugin>
123
        </plugins>
192
        </plugins>
124
      </build>
193
      </build>
125
    </profile>
194
    </profile>
126
  </profiles>
195
  </profiles>
127

    
   

   
128
</project>
196
</project>
  1. dist/pom.xml: Loading...