EDIT#2: This issue came up again for me. If you want to figure out how to modify some package and add it to maven, fine go ahead and read on, but if you're just here to figure out how to get rid of that error (and other similar errors like this involving different properties) then you should just follow the advice in this answer: https://stackoverflow.com/a/34133450/754988. It is much better than mine.
While attacomsian's solution may work for some, I depend on an abstract UserProfile for other services like Google sign in and their solution would break that for me.
A less invasive maneuver that I've found works is to head over to ss-facebook's github and follow the first two lines of their instructions to build from source:
git clone git://github.com/SpringSource/spring-social-facebook.git
cd spring-social-facebook
But before you run the ./gradlew build command, open up this file for editing:
./spring-social-facebook/src/main/java/org/springframework/social/facebook/api/UserOperations.java
Scroll down to the bottom and remove "context" from the array, changing
static final String[] PROFILE_FIELDS = {
"id", "about", "age_range", "birthday", "context", "cover", "currency", "devices", "education", "email",
....
"website", "work"
};
to
static final String[] PROFILE_FIELDS = {
"id", "about", "age_range", "birthday", "cover", "currency", "devices", "education", "email",
....
"website", "work"
};
Now go back to the source folder and run the final command:
./gradlew build
You'll get a ./build folder there with a zip file in it, unzip it to find your working jars! I use maven, and replaced the two remote dependencies that I had with some local dependencies, like so:
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>3.0.0.M1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/spring-social-facebook-3.0.0.BUILD-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook-web</artifactId>
<version>3.0.0.M1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/spring-social-facebook-web-3.0.0.BUILD-SNAPSHOT.jar</systemPath>
</dependency>
EDIT: I have since learned this is not the optimal way to include a custom jar like this with Maven. It's a bit of a rabbit hole to actually get it in there where it works like other jars in your pom. I got it to work better eventually by running these commands to manually install the two jars I made (3.0.1337 is the version I made up to avoid name collision - not sure if it's necessary) ...
mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -Dfile=web/src/main/resources/lib/spring-social-facebook-3.0.1337.BUILD-SNAPSHOT.jar -DgroupId=org.springframework.social -DartifactId=spring-social-facebook -Dversion=3.0.1337 -Dpackaging=jar -DlocalRepositoryPath=web/src/main/resources/local-repo -DgeneratePom=true
mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -Dfile=web/src/main/resources/lib/spring-social-facebook-web-3.0.1337.BUILD-SNAPSHOT.jar -DgroupId=org.springframework.social -DartifactId=spring-social-facebook-web -Dversion=3.0.1337 -Dpackaging=jar -DlocalRepositoryPath=web/src/main/resources/local-repo -DgeneratePom=true
...Into a local repository that I declared in my pom like so:
<repositories>
<repository>
<id>local-repo</id>
<url>file://${project.basedir}/src/main/resources/local-repo</url>
</repository>
</repositories>
and then I added the jars to source control and added a line in my gitignore to ignore the /src/main/resources/local-repo folder.
If anyone has a better way of doing this that retains all of the original code, only removing that "context" string from the array at the end of that file, and hopefully avoids ALL of this junk in favor of a simple singular class replacement or extension, please chime in. I'm just including all of it because it definitely would have saved me a day of having to figure each of these things out one by one.
DISCLAIMER: I do not know what side effects this may have and I am otherwise unfamiliar with this library. Although I doubt that this will hurt much and is clearly an improvement in this one area, the change may have ramifications of which I could have no reasonable foresight without putting more time in working on this library. As such I am not supplying a modified JAR, only writing down some easy instructions for everyone else. Proceed with these instructions at your own risk.
Also, I just checked the license and if you do make this change make sure you follow the instructions that say:
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
If I'm missing any other legal stuff, please comment to let me know.