http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/build-tools/src/main/resources/org/apache/syncope/pmd.xml ---------------------------------------------------------------------- diff --git a/build-tools/src/main/resources/org/apache/syncope/pmd.xml b/build-tools/src/main/resources/org/apache/syncope/pmd.xml deleted file mode 100644 index 1073dce..0000000 --- a/build-tools/src/main/resources/org/apache/syncope/pmd.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?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. - ---> -<ruleset name="Syncope" - xmlns="http://pmd.sf.net/ruleset/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" - xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> - - <rule ref="rulesets/basic.xml"/> - <rule ref="rulesets/naming.xml"> - <exclude name="ShortVariable"/> - <exclude name="LongVariable"/> - </rule> - <rule ref="rulesets/unusedcode.xml"/> - <rule ref="rulesets/design.xml"/> - <rule ref="rulesets/imports.xml"/> - <rule ref="rulesets/strings.xml"> - <exclude name="AvoidDuplicateLiterals"/> - </rule> - <rule ref="rulesets/codesize.xml"/> - <rule ref="rulesets/javabeans.xml"> - <exclude name="BeanMembersShouldSerialize"/> - </rule> - <rule ref="rulesets/coupling.xml"/> - <rule ref="rulesets/controversial.xml"> - <exclude name="NullAssignment"/> - <exclude name="DataflowAnomalyAnalysis"/> - </rule> - <rule ref="rulesets/strictexception.xml"/> - <rule ref="rulesets/typeresolution.xml"/> - -</ruleset>
http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/build-tools/src/main/resources/testdb.sql ---------------------------------------------------------------------- diff --git a/build-tools/src/main/resources/testdb.sql b/build-tools/src/main/resources/testdb.sql deleted file mode 100644 index ff4dd47..0000000 --- a/build-tools/src/main/resources/testdb.sql +++ /dev/null @@ -1,46 +0,0 @@ --- 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. -ALTER USER sa SET PASSWORD '${testdb.password}'; - -DROP TABLE test IF EXISTS; -CREATE TABLE test ( -id VARCHAR(50) PRIMARY KEY, -password VARCHAR(255) NOT NULL, -status VARCHAR(5)); - -INSERT INTO test VALUES ('testuser1', 'password', 'false'); - --- this table must be created in order to provide a specific test for issueSYNCOPE68 -DROP TABLE test2 IF EXISTS; -CREATE TABLE test2 ( -id VARCHAR(50) PRIMARY KEY, -password VARCHAR(255) NOT NULL, -status VARCHAR(5)); - -INSERT INTO test2 VALUES ('testuser2', 'password321', 'false'); -INSERT INTO test2 VALUES ('rossini', 'password321', 'true'); -INSERT INTO test2 VALUES ('verdi', 'password321', 'true'); - --- this table is for issueSYNCOPE230 -DROP TABLE testsync IF EXISTS; -CREATE TABLE TESTSYNC ( -id NUMBER(10) PRIMARY KEY, -username VARCHAR(80), -surname VARCHAR(80), -email VARCHAR(80)); - -INSERT INTO testsync VALUES (965, 'issuesyncope230', 'Surname', '[email protected]'); http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/build-tools/src/main/webapp/WEB-INF/glassfish-web.xml ---------------------------------------------------------------------- diff --git a/build-tools/src/main/webapp/WEB-INF/glassfish-web.xml b/build-tools/src/main/webapp/WEB-INF/glassfish-web.xml deleted file mode 100644 index f2a4332..0000000 --- a/build-tools/src/main/webapp/WEB-INF/glassfish-web.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. - ---> -<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD -GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> -<glassfish-web-app> - <class-loader delegate="false"/> -</glassfish-web-app> http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/build-tools/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/build-tools/src/main/webapp/WEB-INF/web.xml b/build-tools/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 2a0b4ba..0000000 --- a/build-tools/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?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. ---> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" - version="3.0"> - - <context-param> - <param-name>testds.port</param-name> - <param-value>${testds.port}</param-value> - </context-param> - <context-param> - <param-name>testdb.webport</param-name> - <param-value>${testdb.webport}</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.port</param-name> - <param-value>${testconnectorserver.port}</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.key</param-name> - <param-value>${testconnectorserver.key}</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.soap.bundle</param-name> - <param-value>net.tirasa.connid.bundles.soap-${connid.soap.version}.jar</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.db.bundle</param-name> - <param-value>net.tirasa.connid.bundles.db.table-${connid.db.table.version}.jar</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.csvdir.bundle</param-name> - <param-value>net.tirasa.connid.bundles.csvdir-${connid.csvdir.version}.jar</param-value> - </context-param> - <context-param> - <param-name>testconnectorserver.ldap.bundle</param-name> - <param-value>net.tirasa.connid.bundles.ldap-${connid.ldap.version}.jar</param-value> - </context-param> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>classpath*:/*Context.xml</param-value> - </context-param> - - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - <listener> - <listener-class>org.apache.syncope.buildtools.ApacheDSStartStopListener</listener-class> - </listener> - <listener> - <listener-class>org.apache.syncope.buildtools.H2StartStopListener</listener-class> - </listener> - <listener> - <listener-class>org.apache.syncope.buildtools.ConnIdStartStopListener</listener-class> - </listener> - <servlet> - <servlet-name>ApacheDSRootDseServlet</servlet-name> - <servlet-class>org.apache.syncope.buildtools.ApacheDSRootDseServlet</servlet-class> - </servlet> - <servlet> - <servlet-name>ServiceTimeoutServlet</servlet-name> - <servlet-class>org.apache.syncope.buildtools.ServiceTimeoutServlet</servlet-class> - </servlet> - <servlet-mapping> - <servlet-name>ApacheDSRootDseServlet</servlet-name> - <url-pattern>/apacheDS</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>ServiceTimeoutServlet</servlet-name> - <url-pattern>/services/*</url-pattern> - </servlet-mapping> -</web-app> http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/build-tools/src/main/webapp/WEB-INF/weblogic.xml ---------------------------------------------------------------------- diff --git a/build-tools/src/main/webapp/WEB-INF/weblogic.xml b/build-tools/src/main/webapp/WEB-INF/weblogic.xml deleted file mode 100644 index 3d429a5..0000000 --- a/build-tools/src/main/webapp/WEB-INF/weblogic.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?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. ---> -<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app - http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"> - - <context-root>syncope-build-tools</context-root> - - <container-descriptor> - <prefer-application-packages> - <package-name>org.slf4j.*</package-name> - </prefer-application-packages> - </container-descriptor> - -</weblogic-web-app> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/pom.xml ---------------------------------------------------------------------- diff --git a/cli/pom.xml b/cli/pom.xml deleted file mode 100644 index 43a2861..0000000 --- a/cli/pom.xml +++ /dev/null @@ -1,186 +0,0 @@ -<?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/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.syncope</groupId> - <artifactId>syncope</artifactId> - <version>2.0.0-SNAPSHOT</version> - </parent> - - <name>Apache Syncope Command Line Interface</name> - <description>Apache Syncope Command Line Interface</description> - - <groupId>org.apache.syncope</groupId> - <artifactId>syncope-cli</artifactId> - <packaging>jar</packaging> - - <distributionManagement> - <site> - <id>syncope.website</id> - <name>Apache Syncope website</name> - <url>${site.deploymentBaseUrl}/${project.artifactId}</url> - </site> - </distributionManagement> - - <properties> - <log.directory>/tmp</log.directory> - </properties> - - <dependencies> - <dependency> - <groupId>com.beust</groupId> - <artifactId>jcommander</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.syncope</groupId> - <artifactId>syncope-client</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - </dependency> - <dependency> - <groupId>com.lmax</groupId> - <artifactId>disruptor</artifactId> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - </dependency> - - </dependencies> - - <build> - - <defaultGoal>package</defaultGoal> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>2.3</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <createDependencyReducedPom>false</createDependencyReducedPom> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <manifestEntries> - <Main-Class>org.apache.syncope.cli.SyncopeAdm</Main-Class> - </manifestEntries> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> - <resource>messages.properties</resource> - <file>src/main/resources/messages.properties</file> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> - <resource>messages_it_IT.properties</resource> - <file>src/main/resources/messages_it_IT.properties</file> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/spring.handlers</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/spring.schemas</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> - <resource>META-INF/cxf/bus-extensions.txt</resource> - </transformer> - <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"> - <resource>META-INF/wsdl.plugin.xml</resource> - </transformer> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <targetPath>${project.build.directory}/classes</targetPath> - <includes> - <include>log4j2.xml</include> - </includes> - </resource> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <targetPath>${project.build.directory}/classes</targetPath> - <includes> - <include>syncope.properties</include> - </includes> - </resource> - <resource> - <directory>..</directory> - <targetPath>META-INF</targetPath> - <includes> - <include>LICENSE</include> - <include>NOTICE</include> - </includes> - </resource> - </resources> - - </build> - - <profiles> - <profile> - <id>apache-release</id> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> - -</project> http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/SyncopeAdm.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/SyncopeAdm.java b/cli/src/main/java/org/apache/syncope/cli/SyncopeAdm.java deleted file mode 100644 index bcfa748..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/SyncopeAdm.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.syncope.cli; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.ParameterException; -import org.apache.syncope.cli.commands.ConfigurationCommand; -import org.apache.syncope.cli.commands.EntitlementCommand; -import org.apache.syncope.cli.commands.LoggerCommand; -import org.apache.syncope.cli.commands.NotificationCommand; -import org.apache.syncope.cli.commands.PolicyCommand; -import org.apache.syncope.cli.commands.ReportCommand; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SyncopeAdm { - - private static final Logger LOG = LoggerFactory.getLogger(SyncopeAdm.class); - - private static final String helpMessage = "Usage: Main [options]\n" - + " Options:\n" - + " logger --help \n" - + " config --help \n" - + " notification --help \n" - + " report --help \n" - + " policy --help \n" - + " entitlement --help \n"; - - private static final JCommander jcommander = new JCommander(); - - private static LoggerCommand loggerCommand; - - private static ConfigurationCommand configurationCommand; - - private static NotificationCommand notificationCommand; - - private static ReportCommand reportCommand; - - private static PolicyCommand policyCommand; - - private static EntitlementCommand entitlementCommand; - - public static void main(final String[] args) { - LOG.debug("Starting with args \n"); - - for (final String arg : args) { - LOG.debug("Arg: {}", arg); - } - - instantiateCommands(); - - if (args.length == 0) { - System.out.println(helpMessage); - } else { - try { - jcommander.parse(args); - } catch (final ParameterException ioe) { - System.out.println(helpMessage); - LOG.error("Parameter exception", ioe); - } - executeCommand(); - } - - } - - private static void instantiateCommands() { - LOG.debug("Init JCommander"); - loggerCommand = new LoggerCommand(); - jcommander.addCommand(loggerCommand); - LOG.debug("Added LoggerCommand"); - configurationCommand = new ConfigurationCommand(); - jcommander.addCommand(configurationCommand); - LOG.debug("Added ConfigurationCommand"); - notificationCommand = new NotificationCommand(); - jcommander.addCommand(notificationCommand); - LOG.debug("Added NotificationCommand"); - reportCommand = new ReportCommand(); - jcommander.addCommand(reportCommand); - LOG.debug("Added ReportCommand"); - policyCommand = new PolicyCommand(); - jcommander.addCommand(policyCommand); - LOG.debug("Added PolicyCommand"); - entitlementCommand = new EntitlementCommand(); - jcommander.addCommand(entitlementCommand); - LOG.debug("Added EntitlementCommand"); - } - - private static void executeCommand() { - final String command = jcommander.getParsedCommand(); - - LOG.debug("Called command {}", command); - - if ("logger".equalsIgnoreCase(command)) { - loggerCommand.execute(); - } else if ("config".equalsIgnoreCase(command)) { - configurationCommand.execute(); - } else if ("notification".equalsIgnoreCase(command)) { - notificationCommand.execute(); - } else if ("report".equalsIgnoreCase(command)) { - reportCommand.execute(); - } else if ("policy".equalsIgnoreCase(command)) { - policyCommand.execute(); - } else if ("entitlement".equalsIgnoreCase(command)) { - entitlementCommand.execute(); - } - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java b/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java deleted file mode 100644 index 978b7df..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.syncope.cli; - -import java.util.ResourceBundle; -import org.apache.syncope.client.SyncopeClient; -import org.apache.syncope.client.SyncopeClientFactoryBean; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class SyncopeServices { - - private static final Logger LOG = LoggerFactory.getLogger(SyncopeServices.class); - - private final static ResourceBundle SYNCOPE_PROPS = ResourceBundle.getBundle("syncope"); - - private static final SyncopeClient CLIENT = new SyncopeClientFactoryBean() - .setAddress(SYNCOPE_PROPS.getString("syncope.rest.services")) - .create(SYNCOPE_PROPS.getString("syncope.user"), SYNCOPE_PROPS.getString("syncope.password")); - - public static Object get(final Class<?> claz) { - LOG.debug("Creting service for {}", claz.getName()); - return CLIENT.getService(claz); - } - - private SyncopeServices() { - // private constructor for static utility class - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/AbstractCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/AbstractCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/AbstractCommand.java deleted file mode 100644 index e7cddd4..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/AbstractCommand.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.Parameter; - -public abstract class AbstractCommand { - - @Parameter(names = {"-h", "--help"}) - protected boolean help = false; - - @Parameter(names = {"-l", "--list"}) - protected boolean list = false; - - protected abstract void execute(); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/ConfigurationCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/ConfigurationCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/ConfigurationCommand.java deleted file mode 100644 index 5aea462..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/ConfigurationCommand.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.DynamicParameter; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import java.io.IOException; -import java.io.SequenceInputStream; -import java.util.HashMap; -import java.util.Map; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import org.apache.commons.lang3.StringUtils; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.cli.util.XmlUtils; -import org.apache.syncope.common.SyncopeClientException; -import org.apache.syncope.common.services.ConfigurationService; -import org.apache.syncope.common.to.AttributeTO; -import org.apache.syncope.common.to.ConfTO; -import org.apache.syncope.common.wrap.MailTemplate; -import org.apache.syncope.common.wrap.Validator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xml.sax.SAXException; - -@Parameters( - commandNames = "config", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope configuration service") -public class ConfigurationCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(ConfigurationCommand.class); - - private static final Class SYNCOPE_CONFIGURATION_CLASS = ConfigurationService.class; - - private static final String EXPORT_FILE_NAME = "/content.xml"; - - private final String helpMessage = "Usage: config [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -r, --read \n" - + " Syntax: -r={CONF-NAME} \n" - + " -u, --update \n" - + " Syntax: {CONF-NAME}={CONF-VALUE} \n" - + " -c, --create \n" - + " Syntax: {CONF-NAME}={CONF-VALUE} \n" - + " -d, --delete \n" - + " Syntax: -d={CONF-NAME}" - + " -v, --validators \n" - + " -mt, --mail-templates \n" - + " -e, --export \n" - + " Syntax: -e={WHERE-DIR} \n"; - - @Parameter(names = {"-r", "--read"}) - public String confNameToRead; - - @DynamicParameter(names = {"-u", "--update"}) - private final Map<String, String> updateConf = new HashMap<String, String>(); - - @DynamicParameter(names = {"-c", "--create"}) - private final Map<String, String> createConf = new HashMap<String, String>(); - - @Parameter(names = {"-d", "--delete"}) - public String confNameToDelete; - - @Parameter(names = {"-v", "--validators"}) - public boolean validators = false; - - @Parameter(names = {"-mt", "--mail-templates"}) - public boolean mailTemplates = false; - - @Parameter(names = {"-e", "--export"}) - public String export; - - @Override - public void execute() { - final ConfigurationService configurationService = ((ConfigurationService) SyncopeServices. - get(SYNCOPE_CONFIGURATION_CLASS)); - - LOG.debug("Logger service successfully created"); - - if (help) { - LOG.debug("- configuration help command"); - System.out.println(helpMessage); - } else if (list) { - LOG.debug("- configuration list command"); - try { - final ConfTO confTO = configurationService.list(); - for (final AttributeTO attrTO : confTO.getAttrMap().values()) { - System.out.println(" - Conf " + attrTO.getSchema() + " has value(s) " + attrTO.getValues() - + " - readonly: " + attrTO.isReadonly()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (StringUtils.isNotBlank(confNameToRead)) { - LOG.debug("- configuration read {} command", confNameToRead); - try { - final AttributeTO attrTO = configurationService.read(confNameToRead); - System.out.println(" - Conf " + attrTO.getSchema() + " has value(s) " + attrTO.getValues() - + " - readonly: " + attrTO.isReadonly()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (!updateConf.isEmpty()) { - LOG.debug("- configuration update command with params {}", updateConf); - try { - for (final Map.Entry<String, String> entrySet : updateConf.entrySet()) { - final AttributeTO attrTO = configurationService.read(entrySet.getKey()); - attrTO.getValues().clear(); - attrTO.getValues().add(entrySet.getValue()); - configurationService.set(entrySet.getKey(), attrTO); - System.out.println(" - Conf " + attrTO.getSchema() + " has value(s) " + attrTO.getValues() - + " - readonly: " + attrTO.isReadonly()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (!createConf.isEmpty()) { - LOG.debug("- configuration create command with params {}", createConf); - try { - for (final Map.Entry<String, String> entrySet : createConf.entrySet()) { - final AttributeTO attrTO = new AttributeTO(); - attrTO.setSchema(entrySet.getKey()); - attrTO.getValues().add(entrySet.getValue()); - configurationService.set(entrySet.getKey(), attrTO); - System.out.println(" - Conf " + attrTO.getSchema() + " created with value(s) " + attrTO.getValues() - + " - readonly: " + attrTO.isReadonly()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (StringUtils.isNotBlank(confNameToDelete)) { - try { - LOG.debug("- configuration delete {} command", confNameToDelete); - configurationService.delete(confNameToDelete); - System.out.println(" - Conf " + confNameToDelete + " deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (validators) { - LOG.debug("- configuration validators command"); - try { - System.out.println("Conf validator class: "); - for (final Validator validator : configurationService.getValidators()) { - System.out.println(" *** " + validator.getElement()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (mailTemplates) { - LOG.debug("- configuration mailTemplates command"); - try { - System.out.println("Conf mail template for:"); - for (final MailTemplate mailTemplate : configurationService.getMailTemplates()) { - System.out.println(" *** " + mailTemplate.getElement()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (StringUtils.isNotBlank(export)) { - LOG.debug("- configuration export command, directory where xml will be export: {}", export); - - try { - XmlUtils.createXMLFile((SequenceInputStream) configurationService.export().getEntity(), export - + EXPORT_FILE_NAME); - System.out.println(" - " + export + EXPORT_FILE_NAME + " successfully created"); - } catch (final IOException ex) { - LOG.error("Error creating content.xml file in {} directory", export, ex); - System.out.println(" - Error creating " + export + EXPORT_FILE_NAME + " " + ex.getMessage()); - } catch (final ParserConfigurationException ex) { - LOG.error("Error creating content.xml file in {} directory", export, ex); - System.out.println(" - Error creating " + export + EXPORT_FILE_NAME + " " + ex.getMessage()); - } catch (final SAXException ex) { - LOG.error("Error creating content.xml file in {} directory", export, ex); - System.out.println(" - Error creating " + export + EXPORT_FILE_NAME + " " + ex.getMessage()); - } catch (final TransformerConfigurationException ex) { - LOG.error("Error creating content.xml file in {} directory", export, ex); - System.out.println(" - Error creating " + export + EXPORT_FILE_NAME + " " + ex.getMessage()); - } catch (final TransformerException ex) { - LOG.error("Error creating content.xml file in {} directory", export, ex); - System.out.println(" - Error creating " + export + EXPORT_FILE_NAME + " " + ex.getMessage()); - } catch (final SyncopeClientException ex) { - LOG.error("Error calling configuration service", ex); - System.out.println(" - Error calling configuration service " + ex.getMessage()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/EntitlementCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/EntitlementCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/EntitlementCommand.java deleted file mode 100644 index c63dbcb..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/EntitlementCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.common.services.EntitlementService; -import org.apache.syncope.common.wrap.EntitlementTO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Parameters( - commandNames = "entitlement", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope entitlement service") -public class EntitlementCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(EntitlementCommand.class); - - private static final Class SYNCOPE_ENTITLEMENT_CLASS = EntitlementService.class; - - private final String helpMessage = "Usage: entitlement [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -lo, --list-own \n"; - - @Parameter(names = {"-lo", "--list-own"}) - public boolean listOwn = false; - - @Override - public void execute() { - final EntitlementService entitlementService = (EntitlementService) SyncopeServices. - get(SYNCOPE_ENTITLEMENT_CLASS); - LOG.debug("Entitlement service successfully created"); - - if (help) { - LOG.debug("- entitlement help command"); - System.out.println(helpMessage); - } else if (list) { - System.out.println("All entitlement:"); - for (final EntitlementTO entitlementTO : entitlementService.getAllEntitlements()) { - System.out.println(" *** " + entitlementTO.getElement()); - } - } else if (listOwn) { - System.out.println("All own entitlement:"); - for (final EntitlementTO entitlementTO : entitlementService.getOwnEntitlements()) { - System.out.println(" *** " + entitlementTO.getElement()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/LoggerCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/LoggerCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/LoggerCommand.java deleted file mode 100644 index f6007dd..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/LoggerCommand.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.DynamicParameter; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import java.util.HashMap; -import java.util.Map; -import org.apache.commons.lang3.StringUtils; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.common.SyncopeClientException; -import org.apache.syncope.common.services.LoggerService; -import org.apache.syncope.common.to.LoggerTO; -import org.apache.syncope.common.types.LoggerLevel; -import org.apache.syncope.common.types.LoggerType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Parameters( - commandNames = "logger", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope logger service") -public class LoggerCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(LoggerCommand.class); - - private static final Class SYNCOPE_LOGGER_CLASS = LoggerService.class; - - private final String helpMessage = "Usage: logger [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -r, --read \n" - + " Syntax: -r={LOG-NAME} \n" - + " -u, --update \n" - + " Syntax: {LOG-NAME}={LOG-LEVEL} \n" - + " -ua, --update-all \n" - + " Syntax: -ua={LOG-LEVEL} \n" - + " -c, --create \n" - + " Syntax: {LOG-NAME}={LOG-LEVEL} \n" - + " -d, --delete \n" - + " Syntax: -d={LOG-NAME}"; - - @Parameter(names = {"-r", "--read"}) - public String logNameToRead; - - @DynamicParameter(names = {"-u", "--update"}) - private final Map<String, String> updateLogs = new HashMap<String, String>(); - - @Parameter(names = {"-ua", "--update-all"}) - public String logLevel; - - @DynamicParameter(names = {"-c", "--create"}) - private final Map<String, String> createLogs = new HashMap<String, String>(); - - @Parameter(names = {"-d", "--delete"}) - public String logNameToDelete; - - @Override - public void execute() { - final LoggerService loggerService = ((LoggerService) SyncopeServices.get(SYNCOPE_LOGGER_CLASS)); - - LOG.debug("Logger service successfully created"); - - if (help) { - LOG.debug("- logger help command"); - System.out.println(helpMessage); - } else if (list) { - LOG.debug("- logger list command"); - try { - for (final LoggerTO loggerTO : loggerService.list(LoggerType.LOG)) { - System.out.println(" - " + loggerTO.getName() + " -> " + loggerTO.getLevel()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (StringUtils.isNotBlank(logNameToRead)) { - LOG.debug("- logger read {} command", logNameToRead); - try { - final LoggerTO loggerTO = loggerService.read(LoggerType.LOG, logNameToRead); - System.out.println(" - Logger " + loggerTO.getName() + " with level -> " + loggerTO.getLevel()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (!updateLogs.isEmpty()) { - LOG.debug("- logger update command with params {}", updateLogs); - - for (final Map.Entry<String, String> log : updateLogs.entrySet()) { - final LoggerTO loggerTO = loggerService.read(LoggerType.LOG, log.getKey()); - try { - loggerTO.setLevel(LoggerLevel.valueOf(log.getValue())); - loggerService.update(LoggerType.LOG, loggerTO.getName(), loggerTO); - System.out.println(" - Logger " + loggerTO.getName() + " new level -> " + loggerTO.getLevel()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } catch (final IllegalArgumentException ex) { - System.out.println(" - Error: " + log.getValue() + " isn't a valid logger level, try with:"); - for (final LoggerLevel level : LoggerLevel.values()) { - System.out.println(" *** " + level.name()); - } - } - } - } else if (StringUtils.isNotBlank(logLevel)) { - LOG.debug("- logger update all command with level {}", logLevel); - for (final LoggerTO loggerTO : loggerService.list(LoggerType.LOG)) { - try { - loggerTO.setLevel(LoggerLevel.valueOf(logLevel)); - loggerService.update(LoggerType.LOG, loggerTO.getName(), loggerTO); - System.out.println(" - Logger " + loggerTO.getName() + " new level -> " + loggerTO.getLevel()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } catch (final IllegalArgumentException ex) { - System.out.println(" - Error: " + loggerTO.getLevel() + " isn't a valid logger level, try with:"); - for (final LoggerLevel level : LoggerLevel.values()) { - System.out.println(" *** " + level.name()); - } - } - } - } else if (!createLogs.isEmpty()) { - LOG.debug("- logger create command with params {}", createLogs); - - for (final Map.Entry<String, String> entrySet : createLogs.entrySet()) { - final LoggerTO loggerTO = new LoggerTO(); - try { - loggerTO.setName(entrySet.getKey()); - loggerTO.setLevel(LoggerLevel.valueOf(entrySet.getValue())); - loggerService.update(LoggerType.LOG, loggerTO.getName(), loggerTO); - System.out.println(" - Logger " + loggerTO.getName() + " created with level -> " + loggerTO. - getLevel()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } catch (final IllegalArgumentException ex) { - System.out.println(" - Error: " + loggerTO.getLevel() + " isn't a valid logger level, try with:"); - for (final LoggerLevel level : LoggerLevel.values()) { - System.out.println(" *** " + level.name()); - } - } - } - } else if (StringUtils.isNotBlank(logNameToDelete)) { - try { - LOG.debug("- logger delete {} command", logNameToDelete); - loggerService.delete(LoggerType.LOG, logNameToDelete); - System.out.println(" - Logger " + logNameToDelete + " deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/NotificationCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/NotificationCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/NotificationCommand.java deleted file mode 100644 index fdc0d37..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/NotificationCommand.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.common.SyncopeClientException; -import org.apache.syncope.common.services.NotificationService; -import org.apache.syncope.common.to.NotificationTO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Parameters( - commandNames = "notification", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope notification service") -public class NotificationCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(NotificationCommand.class); - - private static final Class SYNCOPE_NOTIFICATION_CLASS = NotificationService.class; - - private final String helpMessage = "Usage: notification [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -r, --read \n" - + " Syntax: -r={NOTIFICATION-ID} \n" - + " -d, --delete \n" - + " Syntax: -d={NOTIFICATION-ID}"; - - @Parameter(names = {"-r", "--read"}) - public Long notificationIdToRead = -1L; - - @Parameter(names = {"-d", "--delete"}) - public Long notificationIdToDelete = -1L; - - @Override - public void execute() { - final NotificationService notificationService = ((NotificationService) SyncopeServices.get( - SYNCOPE_NOTIFICATION_CLASS)); - - LOG.debug("Notification service successfully created"); - - if (help) { - LOG.debug("- notification help command"); - System.out.println(helpMessage); - } else if (list) { - LOG.debug("- notification list command"); - try { - for (final NotificationTO notificationTO : notificationService.list()) { - System.out.println(notificationTO); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (notificationIdToRead > -1L) { - LOG.debug("- notification read {} command", notificationIdToRead); - try { - System.out.println(notificationService.read(notificationIdToRead)); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (notificationIdToDelete > -1L) { - try { - LOG.debug("- notification delete {} command", notificationIdToDelete); - notificationService.delete(notificationIdToDelete); - System.out.println(" - Notification " + notificationIdToDelete + " deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/PolicyCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/PolicyCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/PolicyCommand.java deleted file mode 100644 index d1574eb..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/PolicyCommand.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import org.apache.commons.lang3.StringUtils; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.common.SyncopeClientException; -import org.apache.syncope.common.services.PolicyService; -import org.apache.syncope.common.to.AbstractPolicyTO; -import org.apache.syncope.common.types.PolicyType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Parameters( - commandNames = "policy", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope policy service") -public class PolicyCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(PolicyCommand.class); - - private static final Class SYNCOPE_POLICY_CLASS = PolicyService.class; - - private final String helpMessage = "Usage: policy [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -ll, --list-policy \n" - + " Syntax: -ll={POLICY-TYPE} \n" - + " -r, --read \n" - + " Syntax: -r={POLICY-ID} \n" - + " -d, --delete \n" - + " Syntax: -d={POLICY-ID}"; - - @Parameter(names = {"-ll", "--list-policy"}) - public String policyType; - - @Parameter(names = {"-r", "--read"}) - public Long policyIdToRead = -1L; - - @Parameter(names = {"-d", "--delete"}) - public Long policyIdToDelete = -1L; - - @Override - public void execute() { - final PolicyService policyService = (PolicyService) SyncopeServices.get(SYNCOPE_POLICY_CLASS); - LOG.debug("Policy service successfully created"); - - if (help) { - LOG.debug("- policy help command"); - System.out.println(helpMessage); - } else if (list) { - - } else if (StringUtils.isNotBlank(policyType)) { - LOG.debug("- policy list command for type {}", policyType); - try { - for (final AbstractPolicyTO policyTO : policyService.list(PolicyType.valueOf(policyType))) { - System.out.println(policyTO); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } catch (final IllegalArgumentException ex) { - System.out.println(" - Error: " + policyType + " isn't a valid policy type, try with:"); - for (final PolicyType type : PolicyType.values()) { - System.out.println(" *** " + type.name() + ": " + type.getDescription()); - } - } - } else if (policyIdToRead > -1L) { - LOG.debug("- policy read {} command", policyIdToRead); - try { - System.out.println(policyService.read(policyIdToRead)); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (policyIdToDelete > -1L) { - try { - LOG.debug("- policy delete {} command", policyIdToDelete); - policyService.delete(policyIdToDelete); - System.out.println(" - Report " + policyIdToDelete + " deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/commands/ReportCommand.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/commands/ReportCommand.java b/cli/src/main/java/org/apache/syncope/cli/commands/ReportCommand.java deleted file mode 100644 index 721503b..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/commands/ReportCommand.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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.syncope.cli.commands; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import java.io.IOException; -import java.io.SequenceInputStream; -import java.util.List; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import org.apache.syncope.cli.SyncopeServices; -import org.apache.syncope.cli.util.XmlUtils; -import org.apache.syncope.common.SyncopeClientException; -import org.apache.syncope.common.services.ReportService; -import org.apache.syncope.common.to.ReportExecTO; -import org.apache.syncope.common.to.ReportTO; -import org.apache.syncope.common.types.ReportExecExportFormat; -import org.apache.syncope.common.wrap.ReportletConfClass; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xml.sax.SAXException; - -@Parameters( - commandNames = "report", - optionPrefixes = "-", - separators = "=", - commandDescription = "Apache Syncope report service") -public class ReportCommand extends AbstractCommand { - - private static final Logger LOG = LoggerFactory.getLogger(ReportCommand.class); - - private static final Class SYNCOPE_REPORT_CLASS = ReportService.class; - - private final String helpMessage = "Usage: report [options]\n" - + " Options:\n" - + " -h, --help \n" - + " -l, --list \n" - + " -r, --read \n" - + " Syntax: -r={POLICY-ID} \n" - + " -d, --delete \n" - + " Syntax: -d={POLICY-ID} \n" - + " -e, --execute \n" - + " Syntax: -e={POLICY-ID} \n" - + " -re, --read-executecution \n" - + " Syntax: -re={EXECUTION-ID} \n" - + " -de, --delete-executecution \n" - + " Syntax: -de={EXECUTION-ID} \n" - + " -eer, --export-executecution-result \n" - + " Syntax: -eer={EXECUTION-ID} \n" - + " -rc, --reportlet-class"; - - @Parameter(names = {"-r", "--read"}) - public Long reportIdToRead = -1L; - - @Parameter(names = {"-d", "--delete"}) - public Long reportIdToDelete = -1L; - - @Parameter(names = {"-e", "--execute"}) - public Long reportIdToExecute = -1L; - - @Parameter(names = {"-re", "--read-execution"}) - public Long executionIdToRead = -1L; - - @Parameter(names = {"-de", "--delete-execution"}) - public Long executionIdToDelete = -1L; - - @Parameter(names = {"-eer", "--export-execution-result"}) - public Long exportId = -1L; - - @Parameter(names = {"-rc", "--reportlet-class"}) - public boolean reportletClass = false; - - @Override - public void execute() { - final ReportService reportService = (ReportService) SyncopeServices.get(SYNCOPE_REPORT_CLASS); - LOG.debug("Report service successfully created"); - - if (help) { - LOG.debug("- report help command"); - System.out.println(helpMessage); - } else if (list) { - LOG.debug("- report list command"); - try { - for (final ReportTO reportTO : reportService.list().getResult()) { - System.out.println(reportTO); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (reportIdToRead > -1L) { - LOG.debug("- report read {} command", reportIdToRead); - try { - System.out.println(reportService.read(reportIdToRead)); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (reportIdToDelete > -1L) { - try { - LOG.debug("- report delete {} command", reportIdToDelete); - reportService.delete(reportIdToDelete); - System.out.println(" - Report " + reportIdToDelete + " deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (reportIdToExecute > -1L) { - try { - LOG.debug("- report execute {} command", reportIdToExecute); - reportService.execute(reportIdToExecute); - final List<ReportExecTO> executionList = reportService.read(reportIdToExecute).getExecutions(); - final ReportExecTO lastExecution = executionList.get(executionList.size() - 1); - System.out.println(" - Report execution id: " + lastExecution.getId()); - System.out.println(" - Report execution status: " + lastExecution.getStatus()); - System.out.println(" - Report execution start date: " + lastExecution.getStartDate()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (executionIdToRead > -1L) { - try { - LOG.debug("- report execution read {} command", executionIdToRead); - ReportExecTO reportExecTO = reportService.readExecution(executionIdToRead); - System.out.println(" - Report execution id: " + reportExecTO.getId()); - System.out.println(" - Report execution status: " + reportExecTO.getStatus()); - System.out.println(" - Report execution start date: " + reportExecTO.getStartDate()); - System.out.println(" - Report execution end date: " + reportExecTO.getEndDate()); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (executionIdToDelete > -1L) { - try { - LOG.debug("- report execution delete {} command", executionIdToDelete); - reportService.deleteExecution(executionIdToDelete); - System.out.println(" - Report execution " + executionIdToDelete + "successfyllt deleted!"); - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else if (exportId > -1L) { - LOG.debug("- report export command for report: {}", exportId); - - try { - XmlUtils.createXMLFile((SequenceInputStream) reportService.exportExecutionResult(exportId, - ReportExecExportFormat.XML).getEntity(), "export_" + exportId + ".xml"); - System.out.println(" - " + "export_" + exportId + " successfully created"); - } catch (final IOException ex) { - LOG.error("Error creating xml file", ex); - System.out.println(" - Error creating " + "export_" + exportId + " " + ex.getMessage()); - } catch (final ParserConfigurationException ex) { - LOG.error("Error creating xml file", ex); - System.out.println(" - Error creating " + "export_" + exportId + " " + ex.getMessage()); - } catch (final SAXException ex) { - LOG.error("Error creating xml file", ex); - System.out.println(" - Error creating " + "export_" + exportId + " " + ex.getMessage()); - } catch (final TransformerConfigurationException ex) { - LOG.error("Error creating xml file", ex); - System.out.println(" - Error creating " + "export_" + exportId + " " + ex.getMessage()); - } catch (final TransformerException ex) { - LOG.error("Error creating xml file", ex); - System.out.println(" - Error creating export_" + exportId + " " + ex.getMessage()); - } catch (final SyncopeClientException ex) { - LOG.error("Error calling configuration service", ex); - System.out.println(" - Error calling configuration service " + ex.getMessage()); - } - } else if (reportletClass) { - try { - LOG.debug("- reportlet configuration class list command"); - System.out.println("Reportlet conf classes"); - for (final ReportletConfClass reportletConfClass : reportService.getReportletConfClasses()) { - System.out.println(" *** " + reportletConfClass.getElement()); - } - } catch (final SyncopeClientException ex) { - System.out.println(" - Error: " + ex.getMessage()); - } - } else { - System.out.println(helpMessage); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java b/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java deleted file mode 100644 index 6a8b2e8..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.syncope.cli.util; - -import java.io.File; -import java.io.IOException; -import java.io.SequenceInputStream; -import java.io.StringReader; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import org.apache.cxf.helpers.IOUtils; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -public class XmlUtils { - - public static void createXMLFile(SequenceInputStream sis, String filePath) - throws TransformerConfigurationException, TransformerException, SAXException, IOException, - ParserConfigurationException { - TransformerFactory.newInstance().newTransformer() - .transform(new DOMSource(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( - new InputSource(new StringReader(IOUtils.toString(sis))))), - new StreamResult(new File(filePath))); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/java/org/apache/syncope/cli/validators/DebugLevelValidator.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/syncope/cli/validators/DebugLevelValidator.java b/cli/src/main/java/org/apache/syncope/cli/validators/DebugLevelValidator.java deleted file mode 100644 index ce2389b..0000000 --- a/cli/src/main/java/org/apache/syncope/cli/validators/DebugLevelValidator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.syncope.cli.validators; - -import com.beust.jcommander.IParameterValidator; -import com.beust.jcommander.ParameterException; - -public class DebugLevelValidator implements IParameterValidator { - - @Override - public void validate(final String name, final String value) throws ParameterException { - if (!Levels.contains(value)) { - final StringBuilder exceptionMessage = new StringBuilder(); - exceptionMessage.append("Parameter ") - .append(name) - .append(" should be :\n"); - for (final Levels l : Levels.values()) { - exceptionMessage.append(l).append("\n"); - } - System.out.println(">>>> " + exceptionMessage.toString()); - } - } - - private enum Levels { - - OFF, - FATAL, - ERROR, - WARN, - INFO, - DEBUG, - TRACE, - ALL; - - public static boolean contains(final String name) { - for (final Levels c : Levels.values()) { - if (c.name().equals(name)) { - return true; - } - } - return false; - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/resources/log4j2.xml ---------------------------------------------------------------------- diff --git a/cli/src/main/resources/log4j2.xml b/cli/src/main/resources/log4j2.xml deleted file mode 100644 index 0688f6b..0000000 --- a/cli/src/main/resources/log4j2.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?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. ---> -<configuration status="WARN"> - - <appenders> - - <RollingRandomAccessFile name="main" fileName="${log.directory}/cli.log" - filePattern="${log.directory}/cli-%d{yyyy-MM-dd}.log.gz" - immediateFlush="false" append="true"> - <PatternLayout> - <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern> - </PatternLayout> - <Policies> - <TimeBasedTriggeringPolicy/> - <SizeBasedTriggeringPolicy size="250 MB"/> - </Policies> - </RollingRandomAccessFile> - - </appenders> - - <loggers> - - <asyncLogger name="com.beust" additivity="false" level="DEBUG"> - <appender-ref ref="main"/> - </asyncLogger> - - <asyncLogger name="org.apache.syncope.cli" additivity="false" level="DEBUG"> - <appender-ref ref="main"/> - </asyncLogger> - - <asyncLogger name="org.apache.syncope.client" additivity="false" level="OFF"> - <appender-ref ref="main"/> - </asyncLogger> - - <root level="DEBUG"> - <appender-ref ref="main"/> - </root> - - </loggers> - -</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/cli/src/main/resources/syncope.properties ---------------------------------------------------------------------- diff --git a/cli/src/main/resources/syncope.properties b/cli/src/main/resources/syncope.properties deleted file mode 100644 index 9f84a72..0000000 --- a/cli/src/main/resources/syncope.properties +++ /dev/null @@ -1,19 +0,0 @@ -# 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. -syncope.rest.services=http://localhost:9080/syncope/rest/ -syncope.user=admin -syncope.password=password http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/client/cli/pom.xml ---------------------------------------------------------------------- diff --git a/client/cli/pom.xml b/client/cli/pom.xml new file mode 100644 index 0000000..2bb050d --- /dev/null +++ b/client/cli/pom.xml @@ -0,0 +1,191 @@ +<?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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.syncope</groupId> + <artifactId>syncope-client</artifactId> + <version>2.0.0-SNAPSHOT</version> + </parent> + + <name>Apache Syncope Client CLI</name> + <description>Apache Syncope Client CLI</description> + + <groupId>org.apache.syncope</groupId> + <artifactId>syncope-client-cli</artifactId> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>com.beust</groupId> + <artifactId>jcommander</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.syncope.client</groupId> + <artifactId>syncope-client-lib</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + </dependency> + <dependency> + <groupId>com.lmax</groupId> + <artifactId>disruptor</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + + </dependencies> + + <build> + + <defaultGoal>package</defaultGoal> + + <plugins> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>gmaven-plugin</artifactId> + <inherited>true</inherited> + <executions> + <execution> + <phase>generate-resources</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> + project.properties['log.directory'] = System.getProperty("java.io.tmpdir") + </source> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <inherited>true</inherited> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>org.apache.syncope.cli.SyncopeAdm</Main-Class> + </manifestEntries> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> + <resource>messages.properties</resource> + <file>src/main/resources/messages.properties</file> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> + <resource>messages_it_IT.properties</resource> + <file>src/main/resources/messages_it_IT.properties</file> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> + <resource>META-INF/spring.handlers</resource> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> + <resource>META-INF/spring.schemas</resource> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> + <resource>META-INF/cxf/bus-extensions.txt</resource> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"> + <resource>META-INF/wsdl.plugin.xml</resource> + </transformer> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + </plugins> + + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + + <resource> + <directory>../..</directory> + <targetPath>META-INF</targetPath> + <includes> + <include>LICENSE</include> + <include>NOTICE</include> + </includes> + </resource> + </resources> + + </build> + + <profiles> + <profile> + <id>apache-release</id> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project>
