請問一下
Maven專案資料夾結構如下:
Project
├src/main/java
│ └ com.abc.xyz
│ └Auth.java
└src/main/resources
└certs
└credential.p12
Auth.java裡有段程式碼用來驗證:
=====================================================================
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId(SERVICE_ACCOUNT_EMAIL)
.setServiceAccountScopes(Collections.singleton(
CalendarScopes.CALENDAR_READONLY))
.setServiceAccountPrivateKeyFromP12File(new File("credential.p12"))
.setServiceAccountUser(SERVICE_ACCOUNT_USER)
.build();
=====================================================================
該專案檔的jar部署到Server上後
會出現找不到credential檔案的錯誤訊息
想請問credential檔案應該放在專案或server哪裡才能被找到?
又該怎麼指定路徑呢?