Skip to content

Commit bbc9527

Browse files
committed
Use FRC maven repo. Install Java on Windows at C:\Users\<user>\OpenCV\java
1 parent 6740231 commit bbc9527

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/edu/wpi/first/wpilib/opencv/installer/Installer.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
public class Installer {
2626

2727
private static final String userHome = System.getProperty("user.home");
28-
private static final String wpilibUrl = "http://first.wpi.edu/FRC/roborio/maven";
29-
private static final String githubRepo = "https://github.com/SamCarlberg/opencv-maven/raw/mvn-repo";
28+
private static final String mavenUrl = "http://first.wpi.edu/FRC/roborio/maven/development";
3029
private static final String mavenLocal = userHome + "/.m2/repository";
3130
private static final Path tmpDir;
3231
private static final Path unzippedDir;
@@ -183,7 +182,7 @@ private static void install(ArtifactType type, String location) throws IOExcepti
183182
File local = resolveLocal(artifactId, v);
184183
File source;
185184
if (!local.exists()) {
186-
copyToMavenLocal(githubRepo, groupId, artifactId, v);
185+
copyToMavenLocal(mavenUrl, groupId, artifactId, v);
187186
}
188187
if (local.exists()) {
189188
System.out.println("Using local file at " + local.toURI());
@@ -210,7 +209,7 @@ private static void install(ArtifactType type, String location) throws IOExcepti
210209
}
211210

212211
private static URL resolveRemote(String artifactId, String version) throws MalformedURLException {
213-
return new URL(resolveRelative(githubRepo, artifactId, version));
212+
return new URL(resolveRelative(mavenUrl, artifactId, version));
214213
}
215214

216215
private static File resolveLocal(String artifactId, String version) {
@@ -293,7 +292,7 @@ private static void unsafeCopy(Path src, Path dst) {
293292
* @return the path to the copied jar
294293
*/
295294
private static Path copyToMavenLocal(String repo, String groupId, String artifactId, String version) throws IOException {
296-
String remoteDir = String.format("%s/%s/%s/%s/", repo, groupId.replace('.', '/'), artifactId, version);
295+
String remoteDir = String.format("%s/%s/%s/%s/", repo, groupId.replace('.', '/'), artifactId, openCvVersion);
297296
String name = String.format("%s-%s", artifactId, version);
298297
String dstDir = remoteDir.replace(repo, mavenLocal);
299298
if (!Files.exists(Paths.get(dstDir))) {

src/main/java/edu/wpi/first/wpilib/opencv/installer/platform/win/Windows.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public String defaultJniLocation() {
1616

1717
@Override
1818
public String defaultJavaLocation() {
19-
return "";
19+
return OPENCV_DIR + "\\java";
2020
}
2121

2222
@Override

0 commit comments

Comments
 (0)