problems with the generate-poms target

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problems with the generate-poms target

tychotychonofuba
The target generate-poms can produce parent pom.xml & poms for module and it works fine (now ) for me.
But I want to add in the parent pom 2 plugin's references :
target-platform-configuration &  maven-osgi-test-plugin.

Goal of my project is setting up a transparent headless automated build with Hudson/Jenkins & Maven/tycho (so developpers will not have to know what is a pom file, or what is tycho.).

It's almost done for now (the developpers doesn't know what is tycho), but i still need to modify the parent pom after its generation.

Is there a way for generate-poms target to add both plugins reference (target-platform-configuration and maven-osgi-test-plugin) when i generate all poms ?
If no, do you have a workaround in mind ?

In my opinion, a strengh of tycho is we can keep the same workflow as before (eclipse, manifest first approach) and nobody have to know maven and pom files.

So an interesting feature for Tycho could be to have maven-osgi-test-plugin reference added as soon as a testbundle project is found in the workspace, and the target-platform-configuration reference added as soon as a .target file is found, doest it makes sense ?

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: problems with the generate-poms target

Tobias Oberlies
I think it is a good idea to have generate-poms do as much as possible of the project setup. However I have two questions about your concrete proposal:

1) What do you need to configure on the maven-osgi-test-plugin? Tests are automatically executed if the packaging type is eclipse-test-plugin.

2) In all projects I use, the .target file is contained in a separate Eclipse project. Do you have any experience with the Tycho build if the .target file is contained in any of the source projects? Where do you usually store the .target file?

Regards
Tobias

P.S.: Please use the new mailing list [hidden email] to continue this discussion and for future questions.


> -----Original Message-----
> From: tychotychonofuba [mailto:[hidden email]]
> Sent: 18 April 2011 18:23
> To: [hidden email]
> Subject: [Tycho Users] problems with the generate-poms target
>
> The target generate-poms can produce parent pom.xml & poms for module and
> it
> works fine (now ) for me.
> But I want to add in the parent pom 2 plugin's references :
> target-platform-configuration &  maven-osgi-test-plugin.
>
> Goal of my project is setting up a transparent headless automated build
> with
> Hudson/Jenkins & Maven/tycho (so developpers will not have to know what is
> a
> pom file, or what is tycho.).
>
> It's almost done for now (the developpers doesn't know what is tycho), but
> i
> still need to modify the parent pom after its generation.
>
> Is there a way for generate-poms target to add both plugins reference
> (target-platform-configuration and maven-osgi-test-plugin) when i generate
> all poms ?
> If no, do you have a workaround in mind ?
>
> In my opinion, a strengh of tycho is we can keep the same workflow as
> before
> (eclipse, manifest first approach) and nobody have to know maven and pom
> files.
>
> So an interesting feature for Tycho could be to have maven-osgi-test-
> plugin
> reference added as soon as a testbundle project is found in the workspace,
> and the target-platform-configuration reference added as soon as a .target
> file is found, doest it makes sense ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with the generate-poms target

tychotychonofuba
Here are my answers : 
1) What do you need to configure on the maven-osgi-test-plugin? Tests are automatically executed if the packaging type is eclipse-test-plugin. 

I try your solution, but sadly in fact if I don't put in the build-section of the parent pom a reference to the maven-osgi-test-plugin i don't have any reports of my tests (In normal time, they are in surefire-report a folder created inside each target folder). Maybe I forgot something ?
 

2) In all projects I use, the .target file is contained in a separate Eclipse project. Do you have any experience with the Tycho build if the .target file is contained in any of the source projects? Where do you usually store the .target file?

Our target file is inside a project named release with all the configurations files to work with headless build. I let you see below the complete description of my actual workflow.

1) First I checkout a project named "release" which contains:
- the psf files (team project set eclipse file) which contain the list of all required projects and their source locations (SVN or CVS).
- a build-automation directory containing:
   - Ant4eclipse libraries required to parse and checkout project from .psf files
   - the ws directory where the real projects will be checkout and compiled and in which we already have a pseudo project "target.platform" that describes the target platform to use to build our product

Here is the description of the tree:
 [-] release
  |  [-] build-automation
  |   |   [-] Ant4eclipse
  |   |   [-] ws
  |   |     |  [-] target.platform
  |   |     |      -f- pom.xml
  |   |     |      -f- mytargetfile.target  
  |   |    -f- build.xml
  |  -f- projects-cvs.psf
  |  -f- projects-svn.psf

2) I use Ant4eclipse in an Ant task (build.xml) to parse the psf and checkout (with antSvn or antCvs ) all the needed projects into the build-automation/ws folder

3) I use generate-poms target in order to create the parent pom and all the children pom.xml files for each checked out projects.

4) Then I want to configure Tycho to use the  .target file (inside ws/target.platform/mytargetfile.target) to build my projects.
In order to do that, I found out (looking at how m2eclipse project uses Tycho) that I needed to add the following lines to the parent pom (generated during step 3) :
  <plugin>
       <groupId>org.sonatype.tycho</groupId>
       <artifactId>target-platform-configuration</artifactId>
       <version>0.10.0</version>
       <configuration>
          <resolver>p2</resolver>
          <target>
            <artifact>
                <groupId>[...]</groupId>
                <artifactId>target-platform</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <classifier>mytargetfile</classifier>                 
            </artifact>
          </target>
          <ignoreTychoRepositories>true</ignoreTychoRepositories>
       </configuration>
  </plugin>
 
Whitout those lines, creation of the target platform automatically fail.

5) I also need to add to configure testing:
<plugin>
         <groupId>org.sonatype.tycho</groupId>
         <artifactId>maven-osgi-test-plugin</artifactId>
         <version>0.10.0</version>
 </plugin>
Whitout there is no sure-fire report folder in targets subfolder of the test-projects. So the test doesnt export any result.
 

6) After that i can start compiling my sources, running osgi test, and export the result to sonar for reporting.

My main problem is having to edit the parent pom during the step 4). Mattias Holmqvist and Igor Fedorenko seems to use generate-poms only initially, but i can't do that because we define the projects
in project team set files (psf) so i need to work with the psf in order to be up2date with the project.
 

Thanks for the quick answer.
Hope i will be in the good mailing list this time ;)
Regards
 
Regards
Tobias

P.S.: Please use the new mailing list [hidden email] to continue this discussion and for future questions.


> -----Original Message-----
> From: tychotychonofuba [mailto:[hidden email]]
> Sent: 18 April 2011 18:23
> To: [hidden email]
> Subject: [Tycho Users] problems with the generate-poms target
>
> The target generate-poms can produce parent pom.xml & poms for module and
> it
> works fine (now ) for me.
> But I want to add in the parent pom 2 plugin's references :
> target-platform-configuration &  maven-osgi-test-plugin.
>
> Goal of my project is setting up a transparent headless automated build
> with
> Hudson/Jenkins & Maven/tycho (so developpers will not have to know what is
> a
> pom file, or what is tycho.).
>
> It's almost done for now (the developpers doesn't know what is tycho), but
> i
> still need to modify the parent pom after its generation.
>
> Is there a way for generate-poms target to add both plugins reference
> (target-platform-configuration and maven-osgi-test-plugin) when i generate
> all poms ?
> If no, do you have a workaround in mind ?
>
> In my opinion, a strengh of tycho is we can keep the same workflow as
> before
> (eclipse, manifest first approach) and nobody have to know maven and pom
> files.
>
> So an interesting feature for Tycho could be to have maven-osgi-test-
> plugin
> reference added as soon as a testbundle project is found in the workspace,
> and the target-platform-configuration reference added as soon as a .target
> file is found, doest it makes sense ?



If you reply to this email, your message will be added to the discussion below:
http://software.2206966.n2.nabble.com/problems-with-the-generate-poms-target-tp6284262p6286602.html
To unsubscribe from problems with the generate-poms target, click here.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with the generate-poms target

Tobias Oberlies

(Nope, still the wrong mailing list. The new one is tycho-user at eclipse.org)

 

The fact that you need step 5 seems like a bug. Please create a minimal example project and file a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Tycho

 

Automatically adding the target configuration in case of a .target file in the sources would be a good enhancement. Please file an enhancement at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Tycho. Also, if you want to see this in Tycho rather sooner than later, you should consider providing a patch with implementation and tests.

 

Kind regards

Tobias

 

 

 

From: tychotychonofuba [mailto:[hidden email]]
Sent: 19 April 2011 12:57
To: [hidden email]
Subject: [Tycho Users] Re: problems with the generate-poms target

 

Here are my answers : 

1) What do you need to configure on the maven-osgi-test-plugin? Tests are automatically executed if the packaging type is eclipse-test-plugin. 


I try your solution, but sadly in fact if I don't put in the build-section of the parent pom a reference to the maven-osgi-test-plugin i don't have any reports of my tests (In normal time, they are in surefire-report a folder created inside each target folder). Maybe I forgot something ?
 


2) In all projects I use, the .target file is contained in a separate Eclipse project. Do you have any experience with the Tycho build if the .target file is contained in any of the source projects? Where do you usually store the .target file?


Our target file is inside a project named release with all the configurations files to work with headless build. I let you see below the complete description of my actual workflow.

1) First I checkout a project named "release" which contains:
- the psf files (team project set eclipse file) which contain the list of all required projects and their source locations (SVN or CVS).
- a build-automation directory containing:
   - Ant4eclipse libraries required to parse and checkout project from .psf files
   - the ws directory where the real projects will be checkout and compiled and in which we already have a pseudo project "target.platform" that describes the target platform to use to build our product

Here is the description of the tree:
 [-] release
  |  [-] build-automation
  |   |   [-] Ant4eclipse
  |   |   [-] ws
  |   |     |  [-] target.platform
  |   |     |      -f- pom.xml
  |   |     |      -f- mytargetfile.target  
  |   |    -f- build.xml
  |  -f- projects-cvs.psf
  |  -f- projects-svn.psf

2) I use Ant4eclipse in an Ant task (build.xml) to parse the psf and checkout (with antSvn or antCvs ) all the needed projects into the build-automation/ws folder

3) I use generate-poms target in order to create the parent pom and all the children pom.xml files for each checked out projects.

4) Then I want to configure Tycho to use the  .target file (inside ws/target.platform/mytargetfile.target) to build my projects.
In order to do that, I found out (looking at how m2eclipse project uses Tycho) that I needed to add the following lines to the parent pom (generated during step 3) :
  <plugin>
       <groupId>org.sonatype.tycho</groupId>
       <artifactId>target-platform-configuration</artifactId>
       <version>0.10.0</version>
       <configuration>
          <resolver>p2</resolver>
          <target>
            <artifact>
                <groupId>[...]</groupId>
                <artifactId>target-platform</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <classifier>mytargetfile</classifier>                 
            </artifact>
          </target>
          <ignoreTychoRepositories>true</ignoreTychoRepositories>
       </configuration>
  </plugin>
 
Whitout those lines, creation of the target platform automatically fail.

5) I also need to add to configure testing:
<plugin>
         <groupId>org.sonatype.tycho</groupId>
         <artifactId>maven-osgi-test-plugin</artifactId>
         <version>0.10.0</version>
 </plugin>
Whitout there is no sure-fire report folder in targets subfolder of the test-projects. So the test doesnt export any result.
 

6) After that i can start compiling my sources, running osgi test, and export the result to sonar for reporting.

My main problem is having to edit the parent pom during the step 4). Mattias Holmqvist and Igor Fedorenko seems to use generate-poms only initially, but i can't do that because we define the projects
in project team set files (psf) so i need to work with the psf in order to be up2date with the project.
 


Thanks for the quick answer.
Hope i will be in the good mailing list this time ;)
Regards
 

Regards
Tobias

P.S.: Please use the new mailing list [hidden email] to continue this discussion and for future questions.


> -----Original Message-----
> From: tychotychonofuba [mailto:[hidden email]]
> Sent: 18 April 2011 18:23
> To: [hidden email]
> Subject: [Tycho Users] problems with the generate-poms target
>
> The target generate-poms can produce parent pom.xml & poms for module and
> it
> works fine (now ) for me.
> But I want to add in the parent pom 2 plugin's references :
> target-platform-configuration &  maven-osgi-test-plugin.
>
> Goal of my project is setting up a transparent headless automated build
> with
> Hudson/Jenkins & Maven/tycho (so developpers will not have to know what is
> a
> pom file, or what is tycho.).
>
> It's almost done for now (the developpers doesn't know what is tycho), but
> i
> still need to modify the parent pom after its generation.
>
> Is there a way for generate-poms target to add both plugins reference
> (target-platform-configuration and maven-osgi-test-plugin) when i generate
> all poms ?
> If no, do you have a workaround in mind ?
>
> In my opinion, a strengh of tycho is we can keep the same workflow as
> before
> (eclipse, manifest first approach) and nobody have to know maven and pom
> files.
>
> So an interesting feature for Tycho could be to have maven-osgi-test-
> plugin
> reference added as soon as a testbundle project is found in the workspace,
> and the target-platform-configuration reference added as soon as a .target
> file is found, doest it makes sense ?

 


If you reply to this email, your message will be added to the discussion below:

http://software.2206966.n2.nabble.com/problems-with-the-generate-poms-target-tp6284262p6286602.html

To unsubscribe from problems with the generate-poms target, click here.

 


View this message in context: Re: problems with the generate-poms target

Sent from the Tycho Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with the generate-poms target

tychotychonofuba
This post has NOT been accepted by the mailing list yet.
Hi Tobbias.

You was right, it didn't need the step 5).
I was naming my test bundle **.test, i renamed them into **.tests (with an 's' at the end) and the maven-test-plugin reference is now added in the effective pom. Tycho doesn't recognize the .test (without 's') extension.

So now, the maven-osgi-test-plugin is added, and the packaging type for test bundles is eclipse-test-plugin

For the second part :  
Finaly i developped a small java program in order to customize the parent pom. I call it from an ant script. It add the helios repository tag,  and target-platform-configuration section and another submodule with the target platform.

So now my workflow looks like that (if someone is looking for the same project).
1) checkout psf files and .target file from the svn
2) Use Ant4eclipse to build workspace from psf files.
2) generate poms
3) customize poms (adding helios repository, target-platform-configuration and the module with the .target)
3)  build with Maven/tycho the sources and execute tests.

The main advantage of this approach is the fact that there is no changes on the developer side
(everybody works like yesterday using eclipse, the .psf files, the .target file etc. and nobody need to know anything around maven or tycho).

Everything is ok for me. Thanks for all. In the future, may be it could be great not to have to customise pom like i do (maybe adding repository reference and target-platform-configuration section as soon as a .target file is found in the workspace).  
Loading...