Well since Aspectj is now an Eclipse Project, I guess an Aspectj solution qualifies as well. AspectJ is great for policy enforcements like that, because it lets you create compile-time warnings and errors based on pointcuts. And if you use the AspectJ Developer Tools, you get aspects up and running in Eclipse.
Here's a sample Policy Enforcement Aspect:
public aspect PolicyEnforcement {
pointcut project1Call() : call(* com.project1..*.*(..));
pointcut inProject1() : within(com.project1..*);
pointcut project2Call() : call(* com.project2..*.*(..));
pointcut inProject2() : within(com.project2..*);
declare error : project1Call() && inProject2()
: "Project2 is not allowed to access Project1";
declare error : project2Call() && inProject1()
: "Project1 is not allowed to access Project2";
}
Note: It's perfectly OK to use AspectJ like that during the development phase only without causing any runtime dependencies.