Closed evandrocoan closed 6 years ago
For the first compile, you need to run mvn install -DskipTests
in the top-level directory of the LT checkout, so Maven will place the JAR files in its local repo.
Thanks! The command mvn install -DskipTests
worked, this is the full output:
Why the README.md does not tell to run mvn install -DskipTests
before mvn clean test
?
Alternate way to build from source
Before start: you will need to clone from GitHub and install Java 8 and Apache Maven.
Warning: a complete clone requires downloading more than 360 MB and needs more than 500 MB on disk. This can be reduced if you only need the last few revisions of the master branch by creating a shallow clone:
git clone --depth 5 https://github.com/languagetool-org/languagetool.git
A shallow clone downloads less than 60 MB and needs less than 200 MB on disk.
In the root project folder, run:
mvn clean test
Also, when I run the other command mvn clean test
after the mvn install -DskipTests
, it throwed another error:
[INFO] Running org.languagetool.tokenizers.sr.SerbianSRXSentenceTokenizerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.221 s - in org.languagetool.tokenizers.sr.SerbianSRXSentenceTokenizerTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] SerbianPatternRuleTest.testRules:30->PatternRuleTest.runGrammarRulesFromXmlTest:164->PatternRuleTest.runGrammarRuleForLanguage:176->PatternRuleTest.runTestForLanguage:270->PatternRuleTest.testGrammarRulesFromXML:344->PatternRuleTest.testCorrectSentences:563->PatternRuleTest.match:592 ▒ Runtime
[ERROR] SimpleGrammarEkavianReplaceRuleTest.testRule:42 ▒ Runtime Could not load dicti...
[ERROR] SimpleStyleEkavianReplaceRuleTest.testRule:41 ▒ Runtime Could not load diction...
[ERROR] EkavianSerbianPatternRuleTest.testRules:30->PatternRuleTest.runGrammarRulesFromXmlTest:164->PatternRuleTest.runGrammarRuleForLanguage:176->PatternRuleTest.runTestForLanguage:270->PatternRuleTest.testGrammarRulesFromXML:344->PatternRuleTest.testCorrectSentences:563->PatternRuleTest.match:592 ▒ Runtime
[ERROR] MorfologikEkavianSpellerRuleTest.testMorfologikSpeller:46 ▒ Runtime Could not ...
[ERROR] MorfologikJekavianSpellerRuleTest.testMorfologikSpeller:46 ▒ Runtime Could not...
[ERROR] MorfologikJekavianSpellerRuleTest.testSpellingCheck:56 ▒ Runtime Could not loa...
[ERROR] EkavianSynthesizerTest.testSynthesizeString:34 ▒ Runtime Could not load dictio...
[ERROR] EkavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:32->createTagger:36 ▒ Runtime
[ERROR] EkavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:32->createTagger:36 ▒ Runtime
[ERROR] EkavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:32->createTagger:36 ▒ Runtime
[ERROR] JekavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:33->createTagger:36 ▒ Runtime
[ERROR] JekavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:33->createTagger:36 ▒ Runtime
[ERROR] JekavianTaggerTest>AbstractSerbianTaggerTest.setUp:46->createTagger:33->createTagger:36 ▒ Runtime
[INFO]
[ERROR] Tests run: 23, Failures: 0, Errors: 14, Skipped: 0
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project language-sr: There are test failures.
[ERROR]
[ERROR] Please refer to D:\User\Documents\languagetool\languagetool-language-modules\sr\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :language-sr
These are the full log contents:
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test.txt
These are the contents of the folder surefire-reports
: surefire-reports.zip
On these files, these lines seems to be more relevant:
File: D:/User/Documents/languagetool/languagetool-language-modules/sr/target/surefire-reports/TEST-org.languagetool.rules.sr.SerbianPatternRuleTest.xml
063: <testcase name="testRules" classname="org.languagetool.rules.sr.SerbianPatternRuleTest" time="0.37">
064: <error message="Could not load dictionary from /sr/dictionary/ekavian/serbian.dict" type="java.lang.RuntimeException"><![CDATA[java.lang.RuntimeException: Could not load dictionary from /sr/dictionary/ekavian/serbian.dict
065: at org.languagetool.tagging.BaseTagger.<init>(BaseTagger.java:86)
066: at org.languagetool.tagging.BaseTagger.<init>(BaseTagger.java:74)
067: at org.languagetool.tagging.sr.SerbianTagger.<init>(SerbianTagger.java:36)
068: at org.languagetool.tagging.sr.EkavianTagger.<init>(EkavianTagger.java:28)
069: at org.languagetool.language.Serbian.getTagger(Serbian.java:107)
070: at org.languagetool.JLanguageTool.getRawAnalyzedSentence(JLanguageTool.java:808)
071: at org.languagetool.JLanguageTool.getAnalyzedSentence(JLanguageTool.java:786)
072: at org.languagetool.rules.patterns.PatternRuleTest.match(PatternRuleTest.java:592)
073: at org.languagetool.rules.patterns.PatternRuleTest.testCorrectSentences(PatternRuleTest.java:563)
074: at org.languagetool.rules.patterns.PatternRuleTest.testGrammarRulesFromXML(PatternRuleTest.java:344)
075: at org.languagetool.rules.patterns.PatternRuleTest.runTestForLanguage(PatternRuleTest.java:270)
076: at org.languagetool.rules.patterns.PatternRuleTest.runGrammarRuleForLanguage(PatternRuleTest.java:176)
077: at org.languagetool.rules.patterns.PatternRuleTest.runGrammarRulesFromXmlTest(PatternRuleTest.java:164)
078: at org.languagetool.rules.sr.SerbianPatternRuleTest.testRules(SerbianPatternRuleTest.java:30)
079: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
080: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
081: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
082: at java.lang.reflect.Method.invoke(Method.java:498)
083: at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
084: at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
085: at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
086: at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
087: at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
088: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
089: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
090: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
091: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
092: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
093: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
094: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
095: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
096: at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:369)
097: at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:275)
098: at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:239)
099: at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:160)
100: at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:373)
101: at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:334)
102: at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:119)
103: at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:407)
104: Caused by: java.io.IOException: Use an explicit fsa.dict.encoder=SUFFIX metadata key:
105: at morfologik.stemming.DictionaryMetadata.read(DictionaryMetadata.java:377)
106: at morfologik.stemming.Dictionary.read(Dictionary.java:102)
107: at morfologik.stemming.Dictionary.read(Dictionary.java:88)
108: at org.languagetool.tagging.BaseTagger.<init>(BaseTagger.java:84)
109: ... 38 more
110: ]]></error>
111: <system-out><![CDATA[Running XML validation for sr/grammar.xml...
112: Running XML validation for sr/grammar-barbarism.xml...
113: Running XML validation for sr/grammar-logical.xml...
114: Running XML validation for sr/grammar-punctuation.xml...
115: Running XML validation for sr/grammar-spelling.xml...
116: Running XML validation for sr/grammar-style.xml...
117: Running pattern rule tests for Serbian... ]]></system-out>
118: </testcase>
Why the README.md does not tell to run mvn install -DskipTests before mvn clean test?
Because you only need to run if you compile a sub project, not if you compile the whole project, as the README suggests.
Also, when I run the other command mvn clean test after the mvn install -DskipTests, it throwed another error:
It seems we have symbolic links in git, which maybe don't work properly under Windows. @strn Any reason these *info files must be links or can we duplicate these files in git instead to make the build more robust?
Because you only need to run if you compile a sub project, not if you compile the whole project, as the README suggests.
I am confused. I think compiled the whole project. I ran it on the folder D:/User/Documents/languagetool
. After
git clone --depth 5 https://github.com/languagetool-org/languagetool.git D:/User/Documents/languagetool
Is it D:/User/Documents/languagetool
the root folder?
So, on the root folder D:/User/Documents/languagetool
I need to run:
mvn install -DskipTests
mvn clean test
Or just mvn clean test
?
@danielnaber: Those *info files can be duplicated; I just wanted to save on space, because one and the same file is referenced in more than one place.
The space saving should be welcome. Perhaps skip these tests on windows or may be there is some way to create symlink on windows?
If you run mvn from the LT root folder, no mvn install
is needed, not even the first time. But I see Connection reset
now in your original output, so there was just a temporary network issue on your computer so a dependency could not be found.
The space saving should be welcome. Perhaps skip these tests on windows or may be there is some way to create symlink on windows?
The files are tiny, so it doesn't matter. Please try again with the latest code from git, the build should work now.
Still not passing. I ran it 2 times, and the error was the same:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49:10 min
[INFO] Finished at: 2018-02-04T00:04:41-02:00
[INFO] Final Memory: 26M/68M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project language-uk: Could not resolve dependencies for project org.languagetool:language-uk:jar:4.1-SNAPSHOT: Could not find artifact ua.net.nlp:morfologik-ukrainian-lt:jar:4.0.3 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :language-uk
This is the full log of both 2 times:
Failed to execute goal on project language-uk 1
Failed to execute goal on project language-uk 2
Now also running mvn install -DskipTests
do the same error:
The first time I ran it with
mvn clean test
[ERROR] Failed to execute goal on project language-fr: Could not resolve dependencies for project org.languagetool:language-fr:jar:4.1-SNAPSHOT: Failed to collect dependencies at org.languagetool:hunspell-native-libs:jar:2.9: Failed to read artifact descriptor for org.languagetool:hunspell-native-libs:jar:2.9: Could not transfer artifact org.languagetool:hunspell-native-libs:pom:2.9 from/to central (https://repo.maven.apache.org/maven2): Connection reset -> [Help 1]
When I ran it again with
-X
the error was different:[ERROR] Failed to execute goal on project language-ca: Could not resolve dependencies for project org.languagetool:language-ca:jar:4.1-SNAPSHOT: Failed to collect dependencies at org.softcatala:catalan-pos-dict:jar:1.6: Failed to read artifact descriptor for org.softcatala:catalan-pos-dict:jar:1.6: Could not transfer artifact org.softcatala:catalan-pos-dict:pom:1.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project language-ca: Could not resolve dependencies for project org.languagetool:language-ca:jar:4.1-SNAPSHOT: Failed to collect dependencies at org.softcatala:catalan-pos-dict:jar:1.6
Full logs:
-X
-X