本文整理汇总了Java中org.springframework.roo.project.Repository类的典型用法代码示例。如果您正苦于以下问题:Java Repository类的具体用法?Java Repository怎么用?Java Repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Repository类属于org.springframework.roo.project包,在下文中一共展示了Repository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAnnotations
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* Add addon repository and dependency to get annotations.
*
* @param configuration Configuration element
*/
private void addAnnotations(Element configuration) {
// Install the add-on Google code repository and dependency needed to
// get the annotations
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
}
示例2: setup
import org.springframework.roo.project.Repository; //导入依赖的package包/类
public void setup() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例3: updateConfiguration
import org.springframework.roo.project.Repository; //导入依赖的package包/类
private void updateConfiguration() {
final Element configuration = XmlUtils.getConfiguration(getClass());
final String focusedModuleName = projectOperations
.getFocusedModuleName();
final List<Dependency> dependencyElements = new ArrayList<Dependency>();
for (final Element webFlowDependencyElement : XmlUtils.findElements(
"/configuration/springWebFlow/dependencies/dependency",
configuration)) {
dependencyElements.add(new Dependency(webFlowDependencyElement));
}
projectOperations
.addDependencies(focusedModuleName, dependencyElements);
final List<Repository> repositoryElements = new ArrayList<Repository>();
for (final Element repositoryElement : XmlUtils.findElements(
"/configuration/springWebFlow/repositories/repository",
configuration)) {
repositoryElements.add(new Repository(repositoryElement));
}
projectOperations
.addRepositories(focusedModuleName, repositoryElements);
projectOperations.updateProjectType(focusedModuleName, ProjectType.WAR);
}
示例4: manageDependencies
import org.springframework.roo.project.Repository; //导入依赖的package包/类
private void manageDependencies(final String moduleName) {
final Element configuration = XmlUtils.getConfiguration(getClass());
final List<Dependency> dependencies = new ArrayList<Dependency>();
final List<Element> springDependencies = XmlUtils.findElements(
"/configuration/spring-data-mongodb/dependencies/dependency",
configuration);
for (final Element dependencyElement : springDependencies) {
dependencies.add(new Dependency(dependencyElement));
}
final List<Repository> repositories = new ArrayList<Repository>();
final List<Element> repositoryElements = XmlUtils.findElements(
"/configuration/spring-data-mongodb/repositories/repository",
configuration);
for (final Element repositoryElement : repositoryElements) {
repositories.add(new Repository(repositoryElement));
}
getProjectOperations().addRepositories(moduleName, repositories);
getProjectOperations().addDependencies(moduleName, dependencies);
}
示例5: addAddonDependency
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void addAddonDependency() {
// Get configuration (repository and dependency) XML element
Element conf = XmlUtils.getConfiguration(this.getClass());
// Find repository elements and add them to the project
for (Element repo : XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", conf)) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", conf);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Find dependency elements and update them into the project
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", conf));
}
示例6: setupProjectPom
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* Update project pom: install repositories and dependencies
*/
private void setupProjectPom() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例7: updatePom
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
*
* This method updates dependencies and repositories with the added to
* configuration.xml file
*
* @param configuration
* @param moduleName
* @param projectOperations
*/
public static void updatePom(final Element configuration,
ProjectOperations projectOperations, MetadataService metadataService) {
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
projectOperations.addRepositories(
projectOperations.getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
}
示例8: getInstance
import org.springframework.roo.project.Repository; //导入依赖的package包/类
public Pom getInstance(final Element root, final String pomPath,
final String moduleName) {
Validate.notBlank(pomPath, "POM's canonical path is required");
final String artifactId = XmlUtils.getTextContent(ARTIFACT_ID_XPATH,
root);
final String groupId = getGroupId(root);
final String name = XmlUtils.getTextContent(NAME_XPATH, root);
final String packaging = XmlUtils.getTextContent(PACKAGING_XPATH, root,
DEFAULT_PACKAGING);
String version = XmlUtils.getTextContent(VERSION_XPATH, root);
final String sourceDirectory = XmlUtils.getTextContent(
SOURCE_DIRECTORY_XPATH, root);
final String testSourceDirectory = XmlUtils.getTextContent(
TEST_SOURCE_DIRECTORY_XPATH, root);
final List<Dependency> dependencies = parseElements(Dependency.class,
DEPENDENCY_XPATH, root);
final List<Filter> filters = parseElements(Filter.class, FILTER_XPATH,
root);
final List<Module> modules = getModules(root, pomPath, packaging);
final List<Plugin> plugins = parseElements(Plugin.class, PLUGIN_XPATH,
root);
final List<Property> pomProperties = parseElements(Property.class,
PROPERTY_XPATH, root);
final List<Repository> pluginRepositories = parseElements(
Repository.class, PLUGIN_REPOSITORY_XPATH, root);
final List<Repository> repositories = parseElements(Repository.class,
REPOSITORY_XPATH, root);
final List<Resource> resources = parseElements(Resource.class,
RESOURCE_XPATH, root);
final String projectParentVersion = XmlUtils.getTextContent("/project/parent/version", root);
final Parent parent = getParent(pomPath, root);
if(version == null) {
version = projectParentVersion;
}
final Collection<Path> paths = getPaths(root, packaging);
return new Pom(groupId, artifactId, version, packaging, dependencies,
parent, modules, pomProperties, name, repositories,
pluginRepositories, sourceDirectory, testSourceDirectory,
filters, plugins, resources, pomPath, moduleName, paths);
}
示例9: isAllPluginRepositoriesRegistered
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* Indicates whether all the given plugin repositories are registered, by
* calling {@link #isPluginRepositoryRegistered(Repository)} for each one,
* ignoring any <code>null</code> elements.
*
* @param repositories the plugin repositories to check (can be
* <code>null</code>)
* @return <code>true</code> if a <code>null</code> collection is given
*/
public boolean isAllPluginRepositoriesRegistered(
final Collection<? extends Repository> repositories) {
if (repositories != null) {
for (final Repository repository : repositories) {
if (repository != null
&& !isPluginRepositoryRegistered(repository)) {
return false;
}
}
}
return true;
}
示例10: isAllRepositoriesRegistered
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* Indicates whether all the given repositories are registered. Equivalent
* to calling {@link #isRepositoryRegistered(Repository)} for each one,
* ignoring any <code>null</code> elements.
*
* @param repositories the repositories to check (can be <code>null</code>)
* @return true if a <code>null</code> collection is given
*/
public boolean isAllRepositoriesRegistered(
final Collection<? extends Repository> repositories) {
if (repositories != null) {
for (final Repository repository : repositories) {
if (repository != null && !isRepositoryRegistered(repository)) {
return false;
}
}
}
return true;
}
示例11: updatePomDependencies
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
* This method adds necessary dependencies to project pom.xml
*/
public void updatePomDependencies() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例12: addGvNIXAnnotationsDependecy
import org.springframework.roo.project.Repository; //导入依赖的package包/类
public void addGvNIXAnnotationsDependecy() {
// Install the add-on Google code repository and dependency needed to
// get the annotations
Element conf = XmlUtils.getConfiguration(this.getClass());
// Install repositories
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", conf);
for (Element repo : repos) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", conf);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", conf);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
}
示例13: updateRepositories
import org.springframework.roo.project.Repository; //导入依赖的package包/类
/**
*
* This method update repositories with the added to configuration.xml file
*
* @param configuration
* @param moduleName
* @param projectOperations
*/
public static void updateRepositories(final Element configuration,
String path, ProjectOperations projectOperations) {
final List<Repository> repositories = new ArrayList<Repository>();
final List<Element> geoRepositories = XmlUtils.findElements(path,
configuration);
for (final Element repositoryElement : geoRepositories) {
repositories.add(new Repository(repositoryElement));
}
projectOperations.addRepositories(
projectOperations.getFocusedModuleName(), repositories);
}
示例14: setup
import org.springframework.roo.project.Repository; //导入依赖的package包/类
public void setup() {
// Get add-on configuration file
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on repository needed
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
getProjectOperations().addRepositories(
getProjectOperations().getFocusedModuleName(),
Collections.singleton(new Repository(repo)));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
getProjectOperations().addProperty(
getProjectOperations().getFocusedModuleName(),
new Property(property));
}
// Install dependencies
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(
getMetadataService(), getProjectOperations(), depens);
}
示例15: setupMavenDependency
import org.springframework.roo.project.Repository; //导入依赖的package包/类
public void setupMavenDependency() {
Element configuration = XmlUtils.getConfiguration(getClass());
// Install the add-on Google code repository and dependency needed to
// get the annotations
List<Element> repos = XmlUtils.findElements(
"/configuration/gvnix/repositories/repository", configuration);
for (Element repo : repos) {
projectOperations.addRepository(projectOperations
.getFocusedModuleName(), new Repository(repo));
}
List<Element> depens = XmlUtils.findElements(
"/configuration/gvnix/dependencies/dependency", configuration);
DependenciesVersionManager.manageDependencyVersion(metadataService,
projectOperations, depens);
depens = XmlUtils.findElements(
"/configuration/dependencies/dependency", configuration);
for (Element depen : depens) {
projectOperations.addDependency(projectOperations
.getFocusedModuleName(), new Dependency(depen));
}
// Install properties
List<Element> properties = XmlUtils.findElements(
"/configuration/gvnix/properties/*", configuration);
for (Element property : properties) {
projectOperations.addProperty(projectOperations
.getFocusedModuleName(), new Property(property));
}
}