1

Background:

So my team is using Microsoft's git services and we've set up some CI tests. We are not using Maven, and the project is connected to the remote server through the Eclipse Microsoft Team services plugin, but I try to interact with the remote repo mostly through the command line.

Current Strategy:

I'm not too familiar with how to deal with dependencies on a remote repo for Java projects but I've tried simply pushing the .jar dependencies in our build path with the rest of the source code (I know they're big and there's probably a better way to do this).

Problem:

When I push the .jar files, the CI tests still fail with the following errors:

src\JBLASTests.java(1):src\JBLASTests.java(1,): error : [javac] d:\a\1\s\
  src\JBLASTests.java:1: error: package org.junit does not exist
src\JBLASTests.java(5):src\JBLASTests.java(5,): error : [javac] d:\a\1\s\
  src\JBLASTests.java:5: error: package org.jblas does not exist

And then more error reports related to the missing symbols due to the packages not being found.

Questions:

1) What else needs to be on the repo to make the build work?

2) Is there a better way, besides Maven, to link the libraries to the repo?

(I'm not averse to using Maven I just want to find a simpler solution for the interim).

Apologies if this is a duplicate. I searched but couldn't find any other posts regarding this situation.

Community
  • 1
  • 1
Ezra Goss
  • 124
  • 8
  • How are the dependencies defined? Via a `pom.xml` file? If yes, see https://stackoverflow.com/a/22300875/6505250 and show us your `pom.xml` file. – howlger Aug 20 '17 at 14:10
  • We are not using maven (yet) so we don't have a pom.xml file to manage the build. Unless I'm mistaken, you would only use a pom to handle dependencies in a maven project, right? – Ezra Goss Aug 20 '17 at 15:04
  • The jar files are in a /lib/ folder and I just added them to the build path as project local jars. So whatever eclipse does to make that known is how they are currently defined. I know this means they're added to the .classpath by the git plugin. Not sure what else is edited though (I'm assuming build.xml? but it's not changing when I add the dependencies). – Ezra Goss Aug 20 '17 at 15:07
  • 1
    How does a CI build gets the classpath to run the tests (is `d:\a\1\s\ src\...` a path that exists on your local machine but not on the CI server)? I recommend to use the same solution to manage dependencies for your local machine as for the CI server. – howlger Aug 20 '17 at 15:16
  • I didn't set up the CI so I'll ask the dev who did. Thanks for the tip, once I get an answer I'll get back to you – Ezra Goss Aug 20 '17 at 15:33

1 Answers1

0

It looks like the dev who set up the CI tests set them up with an Ant build task despite that not being how we currently handle dependencies. Thank you howgler for pointing out that the CI might be building differently than I do locally. I'll post this answer in case anyone else runs into this issue and doesn't think to check the CI build settings (and also update the title appropriately).

Lesson

Make sure that the CI build task is the same as how you're building locally. Until you add dependencies and try to push them, your builds might be succeeding, so it can be misleading that your CI settings are incorrect.

Community
  • 1
  • 1
Ezra Goss
  • 124
  • 8