You need to add your portlet.properties under resource folder.
portlet.properties
custom.liferay.base.url = "https://www.liferay.com/"
To read it in your java class
You need to import
import com.liferay.portal.kernel.configuration.Configuration;
import com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil;
and use below code to read from properties file
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
System.out.println("liferay custom url->" +configuration.get("custom.liferay.base.url"));