Java Instrumentation

package com.dms;

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.javalite.activejdbc.Base;
import org.javalite.instrumentation.Instrumentation;

import com.dms.manage.domains.PO.basedata.OrgPo;

public class MakeInstrumentationUtil {

    public static void make() {
        try {
            String resourcePath = ClassLoader.getSystemResource("").getPath();
            Instrumentation instrumentation = new Instrumentation();
            instrumentation.setOutputDirectory(resourcePath);
            instrumentation.instrument();
            
            File properties = new File(resourcePath + "\\activejdbc_models.properties");
            if(properties.exists()) {
                File target = new File(System.getProperty("user.dir") + "\\res\\activejdbc_models.properties");
                FileUtils.copyFile(properties, target);
            }else {
                System.out.println( "properties were not generated successfully." );
            }
        } catch (Exception e) {
            e.printStackTrace ();
        }
    }

    public static void main(String[] args) {
        MakeInstrumentationUtil.make(); // Create Instrumentation here 
    }
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325595981&siteId=291194637