001 /**
002 * Copyright 2011 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016 package org.kuali.common.impex.util;
017
018 import org.kuali.common.impex.spring.XmlSchemaCompareConfig;
019 import org.kuali.common.jdbc.JdbcProjectContext;
020 import org.kuali.common.util.ProjectContext;
021 import org.kuali.common.util.execute.SpringExecutable;
022 import org.kuali.common.util.spring.SpringUtils;
023
024 public class XmlSchemaCompareUtility {
025
026 public static void main(String[] args) {
027
028 if (args.length != 1) {
029 printHelpAndExit();
030 }
031
032 String propertiesLocation = args[0];
033
034 try {
035 // Reset the db using annotated config
036 ProjectContext project = new JdbcProjectContext();
037 SpringExecutable executable = SpringUtils.getSpringExecutable(project, propertiesLocation, XmlSchemaCompareConfig.class);
038 executable.execute();
039 } catch (Exception e) {
040 e.printStackTrace();
041 }
042
043 }
044
045 private static void printHelpAndExit() {
046 System.out.println("Expects one argument, a property file location.");
047 System.exit(1);
048 }
049
050 }