Moved the SprintUtils which is for testing only to be in test directory. Changed pom.xml for different projects to use the utils test-jar. Removed some @Component annotations. Moved majority of the dependencies from cloudstack pom to utils pom

This commit is contained in:
Alex Huang 2013-07-18 21:53:51 -07:00
parent f50908341b
commit b18c72626b
21 changed files with 76 additions and 116 deletions

View File

@ -43,21 +43,7 @@
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>

View File

@ -32,6 +32,11 @@
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>

View File

@ -30,11 +30,7 @@ import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
import org.apache.cloudstack.engine.service.api.ProvisioningService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
@Service("ClusterRestService")
@Produces("application/json")
public class ClusterRestService {
// @Inject

View File

@ -29,11 +29,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.cloud.entity.api.NetworkEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Service("NetworkRestService")
@Component
@Produces("application/json")
public class NetworkRestService {
@PUT @Path("/network/create")

View File

@ -28,11 +28,7 @@ import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
import org.apache.cloudstack.engine.service.api.ProvisioningService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
@Service("PodService")
@Produces({"application/json"})
public class PodRestService {
// @Inject

View File

@ -28,11 +28,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
@Service("VirtualMachineRestService")
@Produces("application/xml")
public class VirtualMachineRestService {

View File

@ -30,11 +30,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
@Service("VolumeRestService")
@Produces("application/json")
public class VolumeRestService {

View File

@ -31,11 +31,7 @@ import javax.ws.rs.QueryParam;
import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
import org.apache.cloudstack.engine.service.api.ProvisioningService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Component
@Service("zoneService")
@Produces({"application/json"})
public class ZoneRestService {
// @Inject

View File

@ -16,11 +16,9 @@
// under the License.
package org.apache.cloudstack.engine.subsystem.api.storage.type;
import org.springframework.stereotype.Component;
@Component
public class DataDisk extends VolumeTypeBase {
public DataDisk() {
this.type = "DataDisk";
type = "DataDisk";
}
}

View File

@ -16,11 +16,9 @@
// under the License.
package org.apache.cloudstack.engine.subsystem.api.storage.type;
import org.springframework.stereotype.Component;
@Component
public class Iso extends VolumeTypeBase {
public Iso() {
this.type = "iso";
type = "iso";
}
}

View File

@ -16,11 +16,9 @@
// under the License.
package org.apache.cloudstack.engine.subsystem.api.storage.type;
import org.springframework.stereotype.Component;
@Component
public class RootDisk extends VolumeTypeBase {
public RootDisk() {
this.type = "Root";
type = "Root";
}
}

View File

@ -20,9 +20,6 @@ import java.util.List;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
@Component
public class VolumeTypeHelper {
static private List<VolumeType> types;
private static VolumeType defaultType = new Unknown();

View File

@ -28,14 +28,10 @@ import javax.ejb.Local;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.springframework.stereotype.Component;
import com.cloud.host.Status;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.ScopeType;
import com.cloud.storage.StoragePoolStatus;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.GenericSearchBuilder;
@ -48,7 +44,6 @@ import com.cloud.utils.db.SearchCriteriaService;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
@Component
@Local(value = { PrimaryDataStoreDao.class })
@DB(txn = false)
public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO, Long> implements PrimaryDataStoreDao {

View File

@ -19,9 +19,7 @@
package org.apache.cloudstack.storage.image.format;
import org.apache.cloudstack.storage.BaseType;
import org.springframework.stereotype.Component;
@Component
public class ISO extends BaseType implements ImageFormat {
private final String type = "ISO";

View File

@ -41,6 +41,5 @@
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
</build>
</project>

View File

@ -1,22 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
--><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. -->
<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">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloudstack-plugins</artifactId>
<name>Apache CloudStack Plugin POM</name>
@ -26,16 +19,15 @@
<artifactId>cloudstack</artifactId>
<version>4.2.0-SNAPSHOT</version>
</parent>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
</build>
<modules>
<module>api/rate-limit</module>
<module>api/discovery</module>
<module>acl/static-role-based</module>
<module>affinity-group-processors/host-anti-affinity</module>
<module>affinity-group-processors/host-anti-affinity</module>
<module>affinity-group-processors/explicit-dedication</module>
<module>deployment-planners/user-concentrated-pod</module>
<module>deployment-planners/user-dispersing</module>
@ -78,6 +70,18 @@
<artifactId>cloud-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
@ -158,6 +162,6 @@
<modules>
<module>hypervisors/simulator</module>
</modules>
</profile>
</profile>
</profiles>
</project>

26
pom.xml
View File

@ -34,7 +34,6 @@
</issueManagement>
<properties>
<!--skipTests>true</skipTests -->
<cs.jdk.version>1.6</cs.jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -197,16 +196,6 @@
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
@ -219,21 +208,6 @@
<version>${org.springframework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
</dependencies>
<build>

View File

@ -23,6 +23,11 @@
<artifactId>commons-io</artifactId>
<version>${cs.commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-core</artifactId>
@ -80,6 +85,11 @@
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
@ -87,8 +97,10 @@
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-api</artifactId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>

View File

@ -26,6 +26,13 @@
<version>4.2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-utils</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId>
@ -44,14 +51,6 @@
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<testResources>
<testResource>
<directory>test/resources</directory>
</testResource>
</testResources>
<resources>
<resource>
<directory>resources</directory>

View File

@ -26,7 +26,28 @@
<version>4.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>