/** * Add Spring Cache starter to provided module. * * @param module the Pom where the starter should be installed. */ private void addSpringCacheDependency(Pom module) { // Parse the configuration.xml file final Element configuration = XmlUtils.getConfiguration(getClass()); final List<Dependency> dependencies = new ArrayList<Dependency>(); final List<Element> auditDependencies = XmlUtils.findElements("/configuration/cache/dependencies/dependency", configuration); for (final Element dependencyElement : auditDependencies) { dependencies.add(new Dependency(dependencyElement)); } getProjectOperations().addDependencies(module.getModuleName(), dependencies); }
private void installApplicationConfiguration(String moduleName) { // Add Spring Boot dependences final Element configuration = XmlUtils.getConfiguration(getClass()); final List<Dependency> requiredDependencies = new ArrayList<Dependency>(); final List<Element> dependencies = XmlUtils.findElements("/configuration/dependencies/dependency", configuration); for (final Element dependencyElement : dependencies) { requiredDependencies.add(new Dependency(dependencyElement)); } getProjectOperations().addDependencies(moduleName, requiredDependencies); // Add Plugins List<Element> plugins = XmlUtils.findElements("/configuration/plugins/plugin", configuration); for (Element element : plugins) { Plugin plugin = new Plugin(element); getProjectOperations().addBuildPlugin(moduleName, plugin); } }
@Override public void configureJpa(final OrmProvider ormProvider, final JdbcDatabase jdbcDatabase, final Pom module, final String jndi, final String hostName, final String databaseName, final String userName, final String password, final String profile, final boolean force) { Validate.notNull(module, "Module required"); Validate.notNull(ormProvider, "ORM provider required"); if (StringUtils.isBlank(jndi)) { Validate.notNull(jdbcDatabase, "JDBC database or JNDI data source required"); } // Parse the configuration.xml file final Element configuration = XmlUtils.getConfiguration(getClass()); // Get the first part of the XPath expressions for unwanted databases // and ORM providers if (jdbcDatabase != null) { final String databaseXPath = getDbXPath(getUnwantedDatabases(jdbcDatabase)); final String providersXPath = getProviderXPath(getUnwantedOrmProviders(ormProvider)); final String startersXPath = getStarterXPath(getUnwantedOrmProviders(ormProvider)); // Updating pom.xml including necessary properties, dependencies and Spring Boot starters updateDependencies(module, configuration, ormProvider, jdbcDatabase, startersXPath, providersXPath, databaseXPath, profile); } // Update Spring Config File with spring.datasource.* domain properties updateApplicationProperties(module.getModuleName(), ormProvider, jdbcDatabase, hostName, databaseName, userName, password, jndi, profile, force); }
/** * Add maven-jar-plugin to provided module. * * @param moduleName the name of the module. */ private void addMavenJarPlugin(String moduleName) { // Add plugin maven-jar-plugin Pom module = projectOperations.getPomFromModuleName(moduleName); // Stop if the plugin is already installed for (final Plugin plugin : module.getBuildPlugins()) { if (plugin.getArtifactId().equals(MAVEN_JAR_PLUGIN)) { return; } } final Element configuration = XmlUtils.getConfiguration(getClass()); final Element plugin = XmlUtils.findFirstElement("/configuration/plugin", configuration); // Now install the plugin itself if (plugin != null) { projectOperations.addBuildPlugin(moduleName, new Plugin(plugin), false); } }
/** * Add needed dependencies and plugins to run created integration tests. * * @param module {@link String} the module name where add dependencies. */ private void addIntegrationTestDependencies(String moduleName) { // Add dependencies if needed projectOperations.addDependency(moduleName, JUNIT_DEPENDENCY); projectOperations.addDependency(moduleName, ASSERTJ_CORE_DEPENDENCY); projectOperations.addDependency(moduleName, SPRING_TEST_DEPENDENCY); projectOperations.addDependency(moduleName, SPRING_BOOT_TEST_DEPENDENCY); // Add plugin maven-failsafe-plugin Pom module = projectOperations.getPomFromModuleName(moduleName); // Stop if the plugin is already installed for (final Plugin plugin : module.getBuildPlugins()) { if (plugin.getArtifactId().equals("maven-failsafe-plugin")) { return; } } final Element configuration = XmlUtils.getConfiguration(getClass()); final Element plugin = XmlUtils.findFirstElement("/configuration/plugin", configuration); // Now install the plugin itself if (plugin != null) { projectOperations.addBuildPlugin(moduleName, new Plugin(plugin)); } }
final Element configuration = XmlUtils.getConfiguration(getClass());
final Element configuration = XmlUtils.getConfiguration(getClass()); final List<Element> plugins = XmlUtils.findElements("/configuration/plugins/plugin", configuration);
/** {@inheritDoc} */ public void setup() { Element configuration = XmlUtils.getConfiguration(getClass()); // Add addon repository and dependency to get annotations addAnnotations(configuration); }
@SuppressWarnings({"unchecked", "rawtypes"}) private void generateConfiguration(JavaType interfaceType, JavaType domainType) { final Element configuration = XmlUtils.getConfiguration(getClass());
/** * This method updates Pom dependencies and repositories */ public void updatePomDependencies() { final Element configuration = XmlUtils.getConfiguration(getClass()); GeoUtils.updatePom(configuration, getProjectOperations(), getMetadataService()); }
/** * This method adds hibernate spatial dependencies and repositories to * pom.xml */ public void addHibernateSpatialDependencies() { // Parse the configuration.xml file final Element configuration = XmlUtils.getConfiguration(getClass()); // Add POM Repositories HibernateSpatialGeoUtils.updateRepositories(configuration, "/configuration/repositories/repository", getProjectOperations()); // Add POM dependencies HibernateSpatialGeoUtils.updateDependencies(configuration, "/configuration/dependencies/dependency", getProjectOperations()); }
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); } }
/** {@inheritDoc} */ public void setup() { Validate.isTrue(isSpringMvcProject(), "Project must be Spring MVC project"); Element configuration = XmlUtils.getConfiguration(getClass()); // Add addon repository and dependency to get annotations addAnnotations(configuration); // Add properties to pom updatePomProperties(configuration); // Add JasperReports dependencies to pom updateDependencies(configuration); // Add JasperReports plugin to pom // TODO: The jasperreports-maven-plugin doesn't support the current // version of JasperReports lib. // updatePlugins(configuration); // Add JasperReports View resolver to webmvc-config.xml and create the // jasper-views.xml config file. addJasperReportsViewResolver(); // Install font family extension in the project installJasperReportsExtensionFonts(); }
/** * Add maven-jar-plugin to provided module. * * @param moduleName the name of the module. */ private void addMavenJarPlugin(String moduleName) { // Add plugin maven-jar-plugin Pom module = projectOperations.getPomFromModuleName(moduleName); // Stop if the plugin is already installed for (final Plugin plugin : module.getBuildPlugins()) { if (plugin.getArtifactId().equals(MAVEN_JAR_PLUGIN)) { return; } } final Element configuration = XmlUtils.getConfiguration(getClass()); final Element plugin = XmlUtils.findFirstElement("/configuration/plugin", configuration); // Now install the plugin itself if (plugin != null) { projectOperations.addBuildPlugin(moduleName, new Plugin(plugin), false); } }
@Override public void configureJpa(final OrmProvider ormProvider, final JdbcDatabase jdbcDatabase, final Pom module, final String jndi, final String hostName, final String databaseName, final String userName, final String password, final String profile, final boolean force) { Validate.notNull(module, "Module required"); Validate.notNull(ormProvider, "ORM provider required"); if (StringUtils.isBlank(jndi)) { Validate.notNull(jdbcDatabase, "JDBC database or JNDI data source required"); } // Parse the configuration.xml file final Element configuration = XmlUtils.getConfiguration(getClass()); // Get the first part of the XPath expressions for unwanted databases // and ORM providers if (jdbcDatabase != null) { final String databaseXPath = getDbXPath(getUnwantedDatabases(jdbcDatabase)); final String providersXPath = getProviderXPath(getUnwantedOrmProviders(ormProvider)); final String startersXPath = getStarterXPath(getUnwantedOrmProviders(ormProvider)); // Updating pom.xml including necessary properties, dependencies and Spring Boot starters updateDependencies(module, configuration, ormProvider, jdbcDatabase, startersXPath, providersXPath, databaseXPath, profile); } // Update Spring Config File with spring.datasource.* domain properties updateApplicationProperties(module.getModuleName(), ormProvider, jdbcDatabase, hostName, databaseName, userName, password, jndi, profile, force); }
private void installMavenPlugin() { // Stop if the plugin is already installed for (final Plugin plugin : projectOperations.getFocusedModule() .getBuildPlugins()) { if (plugin.getArtifactId().equals("selenium-maven-plugin")) { return; } } final Element configuration = XmlUtils.getConfiguration(getClass()); final Element plugin = XmlUtils.findFirstElement( "/configuration/selenium/plugin", configuration); // Now install the plugin itself if (plugin != null) { projectOperations.addBuildPlugin( projectOperations.getFocusedModuleName(), new Plugin(plugin)); } }
private void installMavenPlugins(String moduleName) { final Element configuration = XmlUtils.getConfiguration(getClass()); // Add properties List<Element> properties = XmlUtils.findElements( "/configuration/properties/*", configuration); for (Element property : properties) { projectOperations.addProperty(moduleName, new Property(property)); } // Add Plugins List<Element> elements = XmlUtils.findElements( "/configuration/plugins/plugin", configuration); for (Element element : elements) { Plugin plugin = new Plugin(element); projectOperations.addBuildPlugin( moduleName, plugin); } }
/** {@inheritDoc} */ public void setup() { // Parse the configuration.xml file Element configuration = XmlUtils.getConfiguration(getClass()); // Add POM properties updatePomProperties(configuration); // Add dependencies to POM updateDependencies(configuration); // disable Roo MenuOperations to receive requests from clients // note we disable Roo MenuOp before start reading menu.jspx to avoid // clients create page whereas we are reading menu.jspx disableRooMenuOperations(); // populate menu.xml from Roo menu.jspx createMenu(); // create project menu entity model createEntityModel("~.web.menu"); // create web layer artefacts createWebArtefacts("~.web.menu"); }
/** * {@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)); }
Element conf = XmlUtils.getConfiguration(this.getClass());