在 Jenkins 中初始化属性文件时出错



我在源文件夹"src/test/java"下的包"com.ma.config"中有"OR.properties"属性文件。 我使用以下代码来初始化属性文件,但是当我在 jenkins 中运行时,它给出错误"初始化 propertis 文件时出错",但通过 eclipse 在本地工作正常。你能帮我解决这个问题吗:

 static Properties OR;
 public WebConnector(){
    if(OR==null){
        //initialize OR
     try{
         //initilalize OR
         OR = new Properties();
         FileInputStream fs = new FileInputStream(System.getProperty("user.dir")+"\src\test\java\com\ma\config\OR.properties");
         OR.load(fs);
     }catch(Exception e){
         System.out.println("Error in initialising propertis file");
     }}}
在我看来,

这听起来像是类路径问题。 你能检查一下詹金斯的错误日志吗?

最新更新