BuildProfiles in Java and Scala