New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koans archetype not working with empty Maven repository #171

Closed
DavidWhitlock opened this Issue Jun 18, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@DavidWhitlock
Owner

DavidWhitlock commented Jun 18, 2016

A student just emailed me and said that he got the following error while working with the koans:

$ mvn archetype:generate \
-DarchetypeCatalog=https://dl.bintray.com/davidwhitlock/maven/ \
-DarchetypeGroupId=edu.pdx.cs410J \
-DarchetypeArtifactId=java-koans-archetype \
-DarchetypeVersion=Summer2016 \
-DgroupId=edu.pdx.cs410J.rjr4 \
-DartifactId=koans \
-Dversion=1.0-SNAPSHOT

<snip>

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.sandwich:koans-lib:jar:Summer2014 in https://dl.bintray.com/davidwhitlock/maven was cached in the local repository, resolution will not be reattempted until the update interval of CS410J has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)

Geez. I've got a reference to an artifact from Summer2014. I need to fix that.

This probably worked in my environment because I've got the Summer2014 artifact in my local Maven cache. A new student wouldn't have that old jar and it's not available on bintray to download.

@RJ-Russell

This comment has been minimized.

Show comment
Hide comment
@RJ-Russell

RJ-Russell Jun 18, 2016

Tried changing Summer2014 to Summer2016 on line 55 in pom.xml. Recevied the following error.

[WARNING] 
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive
    at java.util.ResourceBundle.getObject(ResourceBundle.java:450)
    at java.util.ResourceBundle.getString(ResourceBundle.java:407)
    at com.sandwich.koan.ApplicationSettings.isInteractive(ApplicationSettings.java:38)
    at com.sandwich.koan.runner.AppLauncher.main(AppLauncher.java:24)
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.904 s
[INFO] Finished at: 2016-06-17T19:42:40-07:00
[INFO] Final Memory: 11M/158M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project koans: An exception occured while executing the Java class. null: InvocationTargetException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive -> [Help 1]
[ERROR] 

RJ-Russell commented Jun 18, 2016

Tried changing Summer2014 to Summer2016 on line 55 in pom.xml. Recevied the following error.

[WARNING] 
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive
    at java.util.ResourceBundle.getObject(ResourceBundle.java:450)
    at java.util.ResourceBundle.getString(ResourceBundle.java:407)
    at com.sandwich.koan.ApplicationSettings.isInteractive(ApplicationSettings.java:38)
    at com.sandwich.koan.runner.AppLauncher.main(AppLauncher.java:24)
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.904 s
[INFO] Finished at: 2016-06-17T19:42:40-07:00
[INFO] Final Memory: 11M/158M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project koans: An exception occured while executing the Java class. null: InvocationTargetException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive -> [Help 1]
[ERROR] 
@DavidWhitlock

This comment has been minimized.

Show comment
Hide comment
@DavidWhitlock

DavidWhitlock Jun 18, 2016

Owner

Oh, wow. It looks like I never updated the Koans archetype with all of the latest changes. I'm kind of surprised that the integration tests passed.

Owner

DavidWhitlock commented Jun 18, 2016

Oh, wow. It looks like I never updated the Koans archetype with all of the latest changes. I'm kind of surprised that the integration tests passed.

DavidWhitlock added a commit that referenced this issue Jun 18, 2016

DavidWhitlock added a commit that referenced this issue Jun 18, 2016

Merge pull request #172 from DavidWhitlock/issue-171-use-Summer2016-k…
…oans-lib

Address issue #171 by updating the Koans project with the latest changes from https://github.com/DavidWhitlock/java-koans.
@DavidWhitlock

This comment has been minimized.

Show comment
Hide comment
@DavidWhitlock

DavidWhitlock Jun 18, 2016

Owner

Changes to address this issue have been merged to the master branch and have been deployed to the Maven repository.

@RJ-Russell and @Kiarasht, will you guys try creating a Koans project from the latest archetype and let me know how it goes?

Owner

DavidWhitlock commented Jun 18, 2016

Changes to address this issue have been merged to the master branch and have been deployed to the Maven repository.

@RJ-Russell and @Kiarasht, will you guys try creating a Koans project from the latest archetype and let me know how it goes?

@RJ-Russell

This comment has been minimized.

Show comment
Hide comment
@RJ-Russell

RJ-Russell Jun 18, 2016

After removing the original koans project and going through all the steps again from scratch, I still received same errors.

[ERROR] Failed to execute goal on project koans: Could not resolve dependencies for project edu.pdx.cs410J.rjr4:koans:jar:1.0-SNAPSHOT: Could not find artifact com.sandwich:koans-lib:jar:Summer2014 in CS410J (https://dl.bintray.com/davidwhitlock/maven) -> [Help 1]

And then after changing 'Summer2014' in pom.xml to 'Summer2016':

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project koans: An exception occured while executing the Java class. null: InvocationTargetException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive -> [Help 1]```

RJ-Russell commented Jun 18, 2016

After removing the original koans project and going through all the steps again from scratch, I still received same errors.

[ERROR] Failed to execute goal on project koans: Could not resolve dependencies for project edu.pdx.cs410J.rjr4:koans:jar:1.0-SNAPSHOT: Could not find artifact com.sandwich:koans-lib:jar:Summer2014 in CS410J (https://dl.bintray.com/davidwhitlock/maven) -> [Help 1]

And then after changing 'Summer2014' in pom.xml to 'Summer2016':

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project koans: An exception occured while executing the Java class. null: InvocationTargetException: Can't find resource for bundle java.util.PropertyResourceBundle, key interactive -> [Help 1]```
@Kiarasht

This comment has been minimized.

Show comment
Hide comment
@Kiarasht

Kiarasht Jun 18, 2016

That's weird. It worked for me before / after your merge.

C:\Users\Restart\IntellijProjects>mvn archetype:generate -DarchetypeCatalog=https://dl.bintray.com/davidwhitlock/maven/ -DarchetypeGroupId=edu.pdx.cs410J -DarchetypeArtifactId=java-koans-archetype -DarchetypeVersion=Summer2016 -DgroupId=edu.pdx.cs410J.torkian -DartifactId=koans -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [edu.pdx.cs410J:java-koans-archetype:Summer2016] found in catalog https://dl.bintray.com/davidwhitlock/maven/
[INFO] Using property: groupId = edu.pdx.cs410J.torkian
[INFO] Using property: artifactId = koans
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = edu.pdx.cs410J.torkian
Confirm properties configuration:
groupId: edu.pdx.cs410J.torkian
artifactId: koans
version: 1.0-SNAPSHOT
package: edu.pdx.cs410J.torkian
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: java-koans-archetype:Summer2016
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: artifactId, Value: koans
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: packageInPathFormat, Value: edu/pdx/cs410J/torkian
[INFO] Parameter: package, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: artifactId, Value: koans
[WARNING] CP Don't override file C:\Users\Restart\IntellijProjects\koans\app\config\.gitignore
[INFO] project created from Archetype in dir: C:\Users\Restart\IntellijProjects\koans
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.985 s
[INFO] Finished at: 2016-06-18T11:30:03-07:00
[INFO] Final Memory: 15M/177M
[INFO] ------------------------------------------------------------------------

C:\Users\Restart\IntellijProjects>cd koans

C:\Users\Restart\IntellijProjects\koans>mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java Koans 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) > validate @ koans >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ koans ---
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) < validate @ koans <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ koans ---

You need to open the file C:\Users\Restart\IntellijProjects\koans\src\beginner\AboutKoans.java. There should be a method starting with @Koan called findAboutKoansFile, look within it for your first lesson. Once you have solved that, save the file and check back for your next lesson.

Ponder what's going wrong in the: AboutKoans class's findAboutKoansFile method.

Line 11 may offer a clue as to how you may progress, now make haste!

Level: Novice
Progress [--------------------------------------------------] 0/243
Remaining Suites: AboutKoans, AboutAssertions, AboutEquality, AboutPrimitives, AboutStrings, AboutObjects, AboutLoops, AboutInheritance, AboutCasting, AboutConditionals, AboutConstructors, AboutEnums, AboutExceptions, AboutMethodPreference, AboutOperators, AboutArrays, AboutVarArgs, AboutAutoboxing,
 AboutCollections, AboutComparison, AboutDates, AboutEquality, AboutFileIO, AboutInnerClasses, AboutLocale, AboutRegularExpressions, AboutSerialization, AboutMocks, AboutJava7LiteralsEnhancements, AboutStringsInSwitch, AboutDiamondOperator, AboutTryWithResources, AboutRequireNotNull, AboutDefaultMet
hods, AboutOptional, AboutLocalTime, AboutLambdas, AboutStreams, AboutMultipleInheritance

Edit & save a koan to reload or enter 'Q' to exit

Kiarasht commented Jun 18, 2016

That's weird. It worked for me before / after your merge.

C:\Users\Restart\IntellijProjects>mvn archetype:generate -DarchetypeCatalog=https://dl.bintray.com/davidwhitlock/maven/ -DarchetypeGroupId=edu.pdx.cs410J -DarchetypeArtifactId=java-koans-archetype -DarchetypeVersion=Summer2016 -DgroupId=edu.pdx.cs410J.torkian -DartifactId=koans -Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [edu.pdx.cs410J:java-koans-archetype:Summer2016] found in catalog https://dl.bintray.com/davidwhitlock/maven/
[INFO] Using property: groupId = edu.pdx.cs410J.torkian
[INFO] Using property: artifactId = koans
[INFO] Using property: version = 1.0-SNAPSHOT
[INFO] Using property: package = edu.pdx.cs410J.torkian
Confirm properties configuration:
groupId: edu.pdx.cs410J.torkian
artifactId: koans
version: 1.0-SNAPSHOT
package: edu.pdx.cs410J.torkian
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: java-koans-archetype:Summer2016
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: artifactId, Value: koans
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: packageInPathFormat, Value: edu/pdx/cs410J/torkian
[INFO] Parameter: package, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: edu.pdx.cs410J.torkian
[INFO] Parameter: artifactId, Value: koans
[WARNING] CP Don't override file C:\Users\Restart\IntellijProjects\koans\app\config\.gitignore
[INFO] project created from Archetype in dir: C:\Users\Restart\IntellijProjects\koans
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.985 s
[INFO] Finished at: 2016-06-18T11:30:03-07:00
[INFO] Final Memory: 15M/177M
[INFO] ------------------------------------------------------------------------

C:\Users\Restart\IntellijProjects>cd koans

C:\Users\Restart\IntellijProjects\koans>mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java Koans 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) > validate @ koans >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ koans ---
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) < validate @ koans <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ koans ---

You need to open the file C:\Users\Restart\IntellijProjects\koans\src\beginner\AboutKoans.java. There should be a method starting with @Koan called findAboutKoansFile, look within it for your first lesson. Once you have solved that, save the file and check back for your next lesson.

Ponder what's going wrong in the: AboutKoans class's findAboutKoansFile method.

Line 11 may offer a clue as to how you may progress, now make haste!

Level: Novice
Progress [--------------------------------------------------] 0/243
Remaining Suites: AboutKoans, AboutAssertions, AboutEquality, AboutPrimitives, AboutStrings, AboutObjects, AboutLoops, AboutInheritance, AboutCasting, AboutConditionals, AboutConstructors, AboutEnums, AboutExceptions, AboutMethodPreference, AboutOperators, AboutArrays, AboutVarArgs, AboutAutoboxing,
 AboutCollections, AboutComparison, AboutDates, AboutEquality, AboutFileIO, AboutInnerClasses, AboutLocale, AboutRegularExpressions, AboutSerialization, AboutMocks, AboutJava7LiteralsEnhancements, AboutStringsInSwitch, AboutDiamondOperator, AboutTryWithResources, AboutRequireNotNull, AboutDefaultMet
hods, AboutOptional, AboutLocalTime, AboutLambdas, AboutStreams, AboutMultipleInheritance

Edit & save a koan to reload or enter 'Q' to exit
@RJ-Russell

This comment has been minimized.

Show comment
Hide comment
@RJ-Russell

RJ-Russell Jun 18, 2016

I just redid it again...and still not working. I tried this on two different systems again. Same errors.

RJ-Russell commented Jun 18, 2016

I just redid it again...and still not working. I tried this on two different systems again. Same errors.

@RJ-Russell

This comment has been minimized.

Show comment
Hide comment
@RJ-Russell

RJ-Russell Jun 18, 2016

So....after removing maven from my PATH, then then removing the .m2 maven directory from my homedir. Then removing everything koans related...and finally doing a reboot and re-symlinking the mvn exectuable back into my PATH.....and redoing all the koans archetype stuff....it works.

I'm thinking something was cached in there that was causing it to not read the new files?

Anyway..it seems to be working now. Thank you for your time and patience

RJ-Russell commented Jun 18, 2016

So....after removing maven from my PATH, then then removing the .m2 maven directory from my homedir. Then removing everything koans related...and finally doing a reboot and re-symlinking the mvn exectuable back into my PATH.....and redoing all the koans archetype stuff....it works.

I'm thinking something was cached in there that was causing it to not read the new files?

Anyway..it seems to be working now. Thank you for your time and patience

@DavidWhitlock

This comment has been minimized.

Show comment
Hide comment
@DavidWhitlock

DavidWhitlock Jun 19, 2016

Owner

Thank you, @RJ-Russell. I really appreciate you getting a head start on the classwork and finding this critical defect. I'm glad you got it working.

Owner

DavidWhitlock commented Jun 19, 2016

Thank you, @RJ-Russell. I really appreciate you getting a head start on the classwork and finding this critical defect. I'm glad you got it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment