-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-15666 shaded dependencies for hbase-testing-util #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cdeff0f
b291299
d2be94e
d1743b1
97ddf1e
76268c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<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"> | ||
<!-- | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
--> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-build-configuration</artifactId> | ||
<version>3.0.0-SNAPSHOT</version> | ||
<relativePath>../../hbase-build-configuration</relativePath> | ||
</parent> | ||
|
||
<artifactId>hbase-shaded-testing-util-tester</artifactId> | ||
<name>Apache HBase - Shaded - Testing Util Tester</name> | ||
<description>Ensures that hbase-shaded-testing-util works with hbase-shaded-client.</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-log4j12</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-shaded-client</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-shaded-testing-util</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.hbase.shaded; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.apache.hadoop.hbase.HBaseClassTestRule; | ||
import org.apache.hadoop.hbase.HBaseTestingUtility; | ||
import org.apache.hadoop.hbase.TableName; | ||
import org.apache.hadoop.hbase.client.Put; | ||
import org.apache.hadoop.hbase.client.Table; | ||
import org.apache.hadoop.hbase.testclassification.ClientTests; | ||
import org.apache.hadoop.hbase.testclassification.MediumTests; | ||
import org.apache.hadoop.hbase.util.Bytes; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.ClassRule; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
@Category({ ClientTests.class, MediumTests.class }) | ||
public class TestShadedHBaseTestingUtility { | ||
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); | ||
|
||
@ClassRule | ||
public static final HBaseClassTestRule CLASS_RULE = | ||
HBaseClassTestRule.forClass(TestShadedHBaseTestingUtility.class); | ||
|
||
@BeforeClass | ||
public static void setUp() throws Exception { | ||
TEST_UTIL.startMiniCluster(); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDown() throws Exception { | ||
TEST_UTIL.shutdownMiniCluster(); | ||
} | ||
|
||
@Test | ||
public void testCreateTable() throws Exception { | ||
TableName tableName = TableName.valueOf("test"); | ||
|
||
Table table = TEST_UTIL.createTable(tableName, "cf"); | ||
|
||
Put put1 = new Put(Bytes.toBytes("r1")); | ||
put1.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("c"), Bytes.toBytes(1)); | ||
table.put(put1); | ||
|
||
Put put2 = new Put(Bytes.toBytes("r2")); | ||
put2.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("c"), Bytes.toBytes(2)); | ||
table.put(put2); | ||
|
||
int rows = TEST_UTIL.countRows(tableName); | ||
busbey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
assertEquals(2, rows); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<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"> | ||
<!-- | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
--> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>hbase-shaded</artifactId> | ||
<groupId>org.apache.hbase</groupId> | ||
<version>3.0.0-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>hbase-shaded-testing-util</artifactId> | ||
<name>Apache HBase - Shaded - Testing Util</name> | ||
|
||
<dependencies> | ||
<!-- test-jar dependencies --> | ||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-common</artifactId> | ||
<version>${hadoop.version}</version> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PS: OK if you just want to drop these on commit. Don't need to see a new version to just omit the defaults. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of these dependencies are also on the classpath through transitive dependencies with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does that matter? I am 99% sure that test-scoped dependencies are not transitively included (thus, the reason for making an hbase-shaded-testing-util module in the first place). |
||
<exclusions> | ||
<exclusion> | ||
<groupId>javax.servlet.jsp</groupId> | ||
<artifactId>jsp-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-hdfs</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-common</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-server</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-zookeeper</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-hadoop-compat</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-hadoop2-compat</artifactId> | ||
<type>test-jar</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hbase</groupId> | ||
<artifactId>hbase-testing-util</artifactId> | ||
<version>${project.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<!--Make it so assembly:single does nothing in here--> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<skipAssembly>true</skipAssembly> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>aggregate-into-a-jar-with-relocated-third-parties</id> | ||
<configuration> | ||
<artifactSet> | ||
<excludes> | ||
<!-- exclude J2EE modules that come in for JDK11+ (since | ||
hadoop-3.2.0) or modules that come in for JDK8+ but | ||
need not be included --> | ||
<exclude>javax.annotation:javax.annotation-api</exclude> | ||
<exclude>javax.activation:javax.activation-api</exclude> | ||
<!-- | ||
Tell the shade plugin that in this case we want to include hadoop | ||
by leaving out the exclude. | ||
--> | ||
<!-- The rest of these should be kept in sync with the parent pom --> | ||
<exclude>org.apache.hbase:hbase-resource-bundle</exclude> | ||
<exclude>org.slf4j:*</exclude> | ||
<exclude>com.google.code.findbugs:*</exclude> | ||
<exclude>com.github.stephenc.findbugs:*</exclude> | ||
<exclude>org.apache.htrace:*</exclude> | ||
<exclude>org.apache.yetus:*</exclude> | ||
<exclude>log4j:*</exclude> | ||
<exclude>commons-logging:*</exclude> | ||
</excludes> | ||
</artifactSet> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Uh oh!
There was an error while loading. Please reload this page.