Skip to content

Commit

Permalink
KYLO-3021: refactor spring classes out of kylo-commons-util to reduce…
Browse files Browse the repository at this point in the history
… dependencies
  • Loading branch information
harschware committed Nov 10, 2018
1 parent 2b0b35f commit 3780f84
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 58 deletions.
68 changes: 68 additions & 0 deletions commons/commons-spring/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>kylo-commons-spring</artifactId>

<parent>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons</artifactId>
<version>0.10.0-SNAPSHOT</version>
</parent>
<properties>
<java.version>1.7</java.version>
<plugin.license.parentRelative>../../</plugin.license.parentRelative>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>

</build>
</project>
37 changes: 4 additions & 33 deletions commons/commons-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</properties>

<dependencies>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand All @@ -29,51 +28,25 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>


<!-- Quartz framework -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand All @@ -88,7 +61,7 @@
</configuration>
</plugin>

<plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -116,8 +89,6 @@
</execution>
</executions>
</plugin>

</plugins>

</build>
</project>
1 change: 1 addition & 0 deletions commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<module>commons-jpa</module>
<module>commons-spark</module>
<module>commons-hive</module>
<module>commons-spring</module>
<module>commons-test-persistence</module>
<module>commons-test</module>
<module>commons-velocity-api</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@

import com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecution;
import com.thinkbiganalytics.metadata.config.OperationalMetadataConfig;
import com.thinkbiganalytics.metadata.core.feed.BaseFeed;
import com.thinkbiganalytics.metadata.jpa.TestJpaConfiguration;
import com.thinkbiganalytics.metadata.jpa.feed.security.FeedOpsAccessControlRepository;
import com.thinkbiganalytics.metadata.jpa.feed.security.JpaFeedOpsAclEntry;
import com.thinkbiganalytics.metadata.jpa.jobrepo.job.JpaBatchJobExecutionProvider;
import com.thinkbiganalytics.security.AccessController;
import com.thinkbiganalytics.spring.CommonsSpringConfiguration;
import com.thinkbiganalytics.test.security.WithMockJaasUser;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
Expand All @@ -45,12 +42,7 @@
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;
import java.util.stream.StreamSupport;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@SuppressWarnings("SpringJavaAutowiringInspection")
@RunWith(SpringJUnit4ClassRunner.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.thinkbiganalytics.metadata.config.OperationalMetadataConfig;
import com.thinkbiganalytics.metadata.core.feed.BaseFeed;
import com.thinkbiganalytics.metadata.jpa.TestJpaConfiguration;
import com.thinkbiganalytics.metadata.jpa.feed.security.FeedOpsAccessControlRepository;
import com.thinkbiganalytics.metadata.jpa.feed.security.JpaFeedOpsAclEntry;
import com.thinkbiganalytics.security.AccessController;
import com.thinkbiganalytics.security.GroupPrincipal;
Expand Down
2 changes: 1 addition & 1 deletion core/sla/sla-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-util</artifactId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
5 changes: 5 additions & 0 deletions install/install-tar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
<artifactId>kylo-schema-discovery-default</artifactId>
<version>0.10.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-service-app</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
5 changes: 5 additions & 0 deletions plugins/schema-discovery-default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<artifactId>kylo-commons-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.nio.charset.Charset;
import java.util.List;

import javax.annotation.Nullable;
import javax.inject.Inject;

/**
Expand Down
6 changes: 6 additions & 0 deletions plugins/spark-shell-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<artifactId>kylo-commons-rest-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spark-shell-plugin-shared</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
import com.thinkbiganalytics.nifi.rest.model.NifiProperty;
import com.thinkbiganalytics.spring.SpringEnvironmentProperties;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.beanutils.ConvertUtilsBean;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.text.StrLookup;
import org.apache.commons.lang.text.StrSubstitutor;
Expand All @@ -52,7 +49,6 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.naming.spi.ResolveResult;

/**
* Resolves the values for NiFi processor properties using the following logic:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
<artifactId>kylo-ui-annotation-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
Expand Down
5 changes: 5 additions & 0 deletions services/thrift-proxy-service/thrift-proxy-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@
import com.thinkbiganalytics.UsernameCaseStrategyUtil;
import com.thinkbiganalytics.kerberos.KerberosTicketConfiguration;
import com.thinkbiganalytics.kerberos.KerberosUtil;
import com.thinkbiganalytics.scheduler.util.CronExpressionUtil;

import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
Expand Down
5 changes: 5 additions & 0 deletions ui/ui-controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<artifactId>kylo-ui-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.thinkbiganalytics.kylo</groupId>
<artifactId>kylo-commons-spring</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Jersey -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@

import org.glassfish.jersey.servlet.ServletContainer;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.boot.autoconfigure.jersey.JerseyProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.inject.Inject;

@Configuration
public class SpringJerseyConfiguration {

Expand Down

0 comments on commit 3780f84

Please sign in to comment.