Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen(maven tycho build problem)
Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769707] Wed, 02 August 2017 19:53 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
I'm perplexed (again).

I'm migrating our build flow to to Maven Tycho. I'm baby stepping my way through building my Xtext tools with Maven Tcyho.

Thus far I've built the provided Xtext example in Eclipse (org.example.xtext.mydsl or something like that). Then I graduated to building one of my DSLs that has two grammars in both Eclipse and in Jenkins using Maven Tycho.

Now I've gained confidence and I'm trying to build even more complex products. But I've hit a wall.

I have a DSL that successfully builds using Maven Tycho in Eclipse, but won't build in Jenkins.

The symptom appears to be that during compile, Maven is cleaning out the xtend-gen/ directory, but not re-building it. This results in a compile error because My DslActivator.java is trying to import a Class that exists in the xtend-gen directory -> but since that directly was cleaned and never re-generated, it can't compile.

I'm puzzled because all of my pom.xml files have been based on previous successful builds in both Eclipse and Jenkins.

Any helpful hints as to why xtend-gen would be removed, then never re-built would be helpful.

Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769710 is a reply to message #1769707] Wed, 02 August 2017 20:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Are the xtend gen files checked in?
What is the checkin state of .project .classpath and build.properties file
Does build.properties have any warnings ?
Does maven work when called locally / from eclipse
Is the xtend maven plugin configured
Are the phases correct
Did you compare the config of the xtend maven plugin with the one generated by the wizard
Do you see the plugin running in the log
If you run maven with debug it should give some hints how it is configured

Can you share a hello world dsl project with your poms so that I can have a look


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769715 is a reply to message #1769710] Wed, 02 August 2017 21:05 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Christian Dietrich wrote on Wed, 02 August 2017 16:01
Are the xtend gen files checked in?


Yes. The directories and the files. When Jenkins starts the build, I see the xtend-gen directory fill up with revision controlled data, the later get cleaned out. Once it's cleaned, the build quickly fails and xtend-gen never gets re-created.

Quote:
What is the checkin state of .project .classpath and build.properties file


All 3 are checked in.

Quote:
Does build.properties have any warnings ?


No. Manually ran Validate to check

Quote:
Does maven work when called locally / from eclipse


Yes.

Quote:
Is the xtend maven plugin configured


I think so. Here is where I think it's happening in the parent's pom.xml:

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.xtend</groupId>
          <artifactId>xtend-maven-plugin</artifactId>
          <version>${xtextVersion}</version>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <outputDirectory>${basedir}/xtend-gen</outputDirectory>
            <testOutputDirectory>${basedir}/xtend-gen</testOutputDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <filesets>
              <fileset>
                <directory>${basedir}/xtend-gen</directory>
                <includes>
                  <include>**/*</include>
                </includes>
                <directory>${basedir}/xtend-gen</directory>
                <includes>
                  <include>**/*</include>
                </includes>
              </fileset>
            </filesets>
          </configuration>
        </plugin>
       


Quote:
Are the phases correct


I don't know what that means or how to check.

Quote:
Did you compare the config of the xtend maven plugin with the one generated by the wizard


I've tried to copy the xtext specific pom information directly from the default Xtext ones generated if I create a new DSL.

Quote:
Do you see the plugin running in the log


I see maven-clean running:

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ company.bmx.dsl.ui ---

[INFO] Deleting ...company.bmx.dsl.ui/xtend-gen (includes = [**/*], excludes = [])

Then I see the following plug-ins run...

[INFO] --- tycho-packaging-plugin:0.26.0:build-qualifier ...
[INFO] --- tycho-packaging-plugin:0.26.0:validate-id (default-validate-id)...
[INFO] --- tycho-packaging-plugin:0.26.0:validate-version (default-validate-version) ....
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) ...
[INFO] Using 'windows-1252' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
[INFO] --- tycho-compiler-plugin:0.26.0:compile (default-compile) @ company.bmx.dsl.ui

Then I see a maven reactor summary telling me the compile failed.

Quote:
If you run maven with debug it should give some hints how it is configured


Let me try that.

Quote:
Can you share a hello world dsl project with your poms so that I can have a look


Probably not. It's quite complex as it's a DSL depending on an EMF model that's built and deployed into a local file:// repository.

Thank you for trying to help!
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769716 is a reply to message #1769715] Wed, 02 August 2017 21:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
I miss xtend-maven-plugin in the log

Is it configured in the Pom


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769718 is a reply to message #1769716] Wed, 02 August 2017 21:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
https://github.com/cdietrich/xtext-ecore-xcore/blob/master/org.xtext.example.mydsla.ui/pom.xml

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769719 is a reply to message #1769715] Wed, 02 August 2017 21:13 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Here's something interesting....

If I set my maven goals in Jenkins to just be "install" it works.

If I set my maven goals to "clean install", this is what causes xtend-gen to be wiped out and not regenerated.

I suspect the default "maven install" selection of m2's Run As... defaults is just doing "maven install"?

Not sure what to do as I think I actually want my xtend-gen to be built cleanly on each Jenkins build.
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769722 is a reply to message #1769719] Wed, 02 August 2017 21:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
As I said i needed something reproducible for further analysis
For that problem it should not role if you import emf etc


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven Tycho Build - Plugin Removes and Doesn't Regenerate its xtend-gen [message #1769724 is a reply to message #1769718] Wed, 02 August 2017 21:45 Go to previous message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Christian Dietrich wrote on Wed, 02 August 2017 17:11
https://github.com/cdietrich/xtext-ecore-xcore/blob/master/org.xtext.example.mydsla.ui/pom.xml


Thank you very much! This was my mistake. As I converted existing Xtext plug-ins to maven, I did not add the build section to the pom.xml. Once I did that, I could run "clean install" in Jenkins.


Previous Topic:Dependency error while upgrading to 2.12
Next Topic:Setting up Xtext dev. environment (Help needed)
Goto Forum:
  


Current Time: Tue Mar 19 04:46:16 GMT 2024

Powered by FUDForum. Page generated in 0.02697 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top