title: Unable to load CoreNLP Shift-Reduce model into CoreNLP jar
body: <p>I don't understand how to load CoreNLP's Shift-Reduce Constituency Parser (SRCP) from my java app.</p>
  
  <p>I'm using Apache Maven to manage my project's dependencies. Per the docs, the SRCP model is not bundled with CoreNLP, so I have downloaded stanford-srparser-2014-10-23-models.jar separately (<a href="http://nlp.stanford.edu/software/srparser.shtml" rel="nofollow">http://nlp.stanford.edu/software/srparser.shtml</a>) and placed that file in:</p>
  
  <pre><code>~/.m2/repository/edu/stanford/nlp/stanford-corenlp/3.5.2/stanford-srparser-2014-10-23-models.jar 
  </code></pre>
  
  <p>That is the same directory as the core dependency jar </p>
  
  <pre><code>~/.m2/repository/edu/stanford/nlp/stanford-corenlp/3.5.2/stanford-corenlp-3.5.2.jar
  </code></pre>
  
  <p>Here is the relevant portion of my project's pom.xml:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;edu.stanford.nlp&lt;/groupId&gt;
          &lt;artifactId&gt;stanford-corenlp&lt;/artifactId&gt;
          &lt;version&gt;3.5.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;edu.stanford.nlp&lt;/groupId&gt;
          &lt;artifactId&gt;stanford-corenlp&lt;/artifactId&gt;
          &lt;version&gt;3.5.2&lt;/version&gt;
          &lt;classifier&gt;models&lt;/classifier&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Compiling is successful:</p>
  
  <pre><code>mvn clean compile
  </code></pre>
  
  <p>But when I try to load the app, I receive:</p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
  ...
  Caused by: edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to resolve "edu/stanford/nlp/models/srparser/englishSR.ser.gz" as either class path, filename or URL
  </code></pre>
  
  <p>I unzipped the compiled project war, and "edu/stanford/nlp/models/srparser/englishSR.ser.gz" is not present.</p>
  
  <p>Here is how I'm calling the model in my app:</p>
  
  <pre><code>// Initialize a CoreNLP pipeline
  public static Properties props = new Properties();
  public static StanfordCoreNLP pipeline;
  
  // Set the CoreNLP pipeline annotators.
  props.setProperty("annotators", "tokenize, ssplit, parse, sentiment");
  props.setProperty("parse.model", "edu/stanford/nlp/models/srparser/englishSR.ser.gz");
  pipeline = new StanfordCoreNLP(props);
  </code></pre>
  
  <p>How can I update my Maven config to force my CoreNLP dependency to include the srparser model? Keep in mind that I need this configuration to run in other developers' environments, so the solution should be clean and reusable if possible.</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>In response to @jah's comment, below are the results of <code>mvn dependency:tree</code>. The build succeeds, but the srparser model is not compiled/present:</p>
  
  <pre><code>[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ [REDACTED] ---
  
  Downloading:
  
  ...
  
  [INFO] com.[REDACTED].nlp:nlp:war:0.1.0
  [INFO] +- com.strategicgains:RestExpress:jar:0.11.2:compile
  [INFO] |  +- com.strategicgains:RestExpress-Common:jar:0.11.2:compile
  [INFO] |  +- com.strategicgains:DateAdapterJ:jar:1.1.4:compile
  [INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
  [INFO] |  |  +- xmlpull:xmlpull:jar:1.1.3.1:compile
  [INFO] |  |  \- xpp3:xpp3_min:jar:1.1.4c:compile
  [INFO] |  +- io.netty:netty-all:jar:4.0.29.Final:compile
  [INFO] |  +- org.owasp.encoder:encoder:jar:1.1.1:compile
  [INFO] |  \- com.jcraft:jzlib:jar:1.1.3:compile
  [INFO] +- junit:junit:jar:4.11:test
  [INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
  [INFO] +- edu.stanford.nlp:stanford-corenlp:jar:3.5.2:compile
  [INFO] |  +- com.io7m.xom:xom:jar:1.2.10:compile
  [INFO] |  |  +- xml-apis:xml-apis:jar:1.3.03:compile
  [INFO] |  |  +- xerces:xercesImpl:jar:2.8.0:compile
  [INFO] |  |  \- xalan:xalan:jar:2.7.0:compile
  [INFO] |  +- joda-time:joda-time:jar:2.1:compile
  [INFO] |  +- de.jollyday:jollyday:jar:0.4.7:compile
  [INFO] |  |  \- javax.xml.bind:jaxb-api:jar:2.2.7:compile
  [INFO] |  +- com.googlecode.efficient-java-matrix-library:ejml:jar:0.23:compile
  [INFO] |  \- javax.json:javax.json-api:jar:1.0:compile
  [INFO] +- edu.stanford.nlp:stanford-corenlp:jar:models:3.5.2:compile
  [INFO] +- org.json:json:jar:20151123:compile
  [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.4:compile
  [INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
  [INFO] |  \- com.fasterxml.jackson.core:jackson-core:jar:2.6.4:compile
  [INFO] \- commons-io:commons-io:jar:1.3.2:compile
  </code></pre>