Unable to build language on command-line
After migrating to Spoofax 1.3, I’m unable to build a language on the command-line. If I try
mvn clean verify
with a newly generated Entity language, I get the following error:... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23.514s [INFO] Finished at: Fri Nov 14 17:03:21 PST 2014 [INFO] Final Memory: 92M/1462M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (spoofax-generate-sources) on project Ent: An Ant BuildException has occured: The following error occurred while executing this line: [ERROR] /home/oskar/workspace/Ent/build.generated.xml:509: The following error occurred while executing this line: [ERROR] /home/oskar/workspace/Ent/build.generated.xml:561: Java returned: 1 [ERROR] around Ant part ...<ant antfile="build.main.xml" inheritRefs="true">... @ 9:52 in /home/oskar/workspace/Ent/target/antrun/build-main.xml [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/MojoExecutionException
(Line 561 invokes
org.strategoxt.strj.Main
.)Also, documentation on how to build an Eclipse update site is missing and doing it the old way doesn’t work anymore.
If someone could provide some insights on how to build an Eclipse update site, that would be really useful.
Submitted by Oskar van Rest on 15 November 2014 at 02:26
Issue Log
You need to show more of build output, particularly the last ant build output, since the error is generated inside ant.
It works now when I do
mvn verify
instead ofmvn clean verify
.mvn clean
removes all files insrc-gen
but those files are not re-generated from the command-line. That is still only possible from within Eclipse right?Should I update the documentation to say
mvn verify
instead ofmvn clean verify
and explain thatsrc-gen
should be generated from within Eclipse beforehand?Also, what about building an Eclipse update site?
Seems like
mvn clean
is necessary formvn verify
to work: if I don’t domvn clean
, thenmvn verify
won’t create directorybuilddeps
.My solution now is:
mv src-gen/ src-gen_temp/ mvn clean mv src-gen_temp/ src-gen/ mvn verify
Cleaning removing
src-gen
is still an issue indeed, because we cannot run the on-save handler for languages on the command-line yet. To work around this, add the following plugin execution to your language’s POM file:<!-- Hack to prevent the src-gen folder from being cleaned. Since the build cannot run meta-languages such as SDF3, the src-gen folder is committed to the git repository. The clean goal will clean the src-gen folder, temporarily renaming it will prevent that. This hack overrides the spoofax-clean antrun execution from the parent POM. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>spoofax-clean</id> <goals> <goal>run</goal> </goals> <phase>clean</phase> <configuration> <skip>${skip-language-build}</skip> <target> <move file="src-gen" tofile="src-gen-keep" /> <ant antfile="build.main.xml" inheritRefs="true"> <target name="clean" /> </ant> <move file="src-gen-keep" tofile="src-gen" /> </target> </configuration> </execution> </executions> </plugin>
Then you should be able to run
mvn clean verify
normally.
Ok thanks.
Log in to post comments