Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347416 - Support custom output-filename in tycho-p2-repository-plugin
Summary: Support custom output-filename in tycho-p2-repository-plugin
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement with 9 votes (vote)
Target Milestone: ---   Edit
Assignee: Jan Sievers CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 05:04 EDT by Steffen Kriese CLA
Modified: 2021-04-28 16:55 EDT (History)
4 users (show)

See Also:


Attachments
New parameter 'finalName' for the repo archive file name (21.73 KB, patch)
2012-04-14 03:39 EDT, Michael Pellaton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Kriese CLA 2011-05-27 05:04:13 EDT
I want like to build a targetplatform with Tycho containing all jar and its depdendencies. Therefore I am using the tycho-p2-repository-plugin:

<plugin>
	<groupId>org.sonatype.tycho</groupId>
	<artifactId>tycho-p2-repository-plugin</artifactId>
	<version>${tycho-version}</version>
	<configuration>
			<includeAllDependencies>true</includeAllDependencies>
			<createArtifactRepository>true</createArtifactRepository>
			<compress>true</compress>
		</configuration>
</plugin>

The result is a zipfile with a p2 repository, that is named like the project/artifact itself for example org.example.build.updatesite.zip. I would like the name to include the timestamp and version of the build and therefore need a configuration-option like <outputfilename>.
Comment 1 Tobias Oberlies CLA 2011-06-10 12:18:33 EDT
Actually, you don't need a new parameter for this. The file name in the target folder doesn't matter at all, so we could just change it to include the qualified version of the module. Would this help?
Comment 2 Steffen Kriese CLA 2011-06-14 02:43:50 EDT
Not just yet. I would like to have the possibility to give the zip file a name like myproduct-1.2.3-20110614.zip instead of org.example.build.updatesite.zip.
Comment 3 Steffen Kriese CLA 2011-08-22 08:18:58 EDT
Adding the qualified version to the file name would improve the current situation, but its not the final solution. The background is, we are providing targetplatforms to our customers as a download. So we need to give them a name with a version, build-id, environment etc. Would be great to see this fixed, so we can finally move from pde-build to tycho.
Comment 4 Christian Campo CLA 2011-09-02 09:03:47 EDT
(In reply to comment #1)
> Actually, you don't need a new parameter for this. The file name in the target
> folder doesn't matter at all, so we could just change it to include the
> qualified version of the module. Would this help?

Hi Tobias,

What would the qualified version exactly look like…Current the target platform for Riena that we build is called Riena-target-201109020507-win32.zip (for the Target platform) (that includes Riena and Equinox and RCP and all this) or its called Riena-p2repo-201109020507-win32.zip (which is only Riena as p2 repo).

If we use Tycho we get something like this org.eclipse.riena.build.updatesite.zip.

So what would we get with the qualified version that you are proposing ?

thanks
christian

p.s.s Riena build is all on Eclipse.org. So if you care to look at the pom.xml I could give you a pointer,
Comment 5 Tobias Oberlies CLA 2011-09-02 09:10:37 EDT
My idea was to use <artifactId>-<version>.zip
Comment 6 Christian Campo CLA 2011-09-02 09:29:02 EDT
(In reply to comment #5)
> My idea was to use <artifactId>-<version>.zip

Well you run a nightly build that is untagged for a product. So the version in the product is 4.0.0.qualifier. Say the artifact (is that the artifact of the product) would be org.eclipse.riena.build.product ?

So I wanna build something for today 12:00 am……

So obviously org.eclipse.riena.build.product-4.0.0.qualifier.zip is really not enough. 

That seems to be a quite common thing that you do nightly builds and need something like a build id which currently is often a timestamp. So we need something like that for the zip of the p2 update site so that we can distinguish them and upload them to a web upload directory.
Comment 7 Tobias Oberlies CLA 2011-09-02 10:02:04 EDT
So, <artifactId>-<qualifiedVersion>.zip would be good enough?
Comment 8 Christian Campo CLA 2011-09-02 10:33:29 EDT
(In reply to comment #7)
> So, <artifactId>-<qualifiedVersion>.zip would be good enough?

I said "So obviously org.eclipse.riena.build.product-4.0.0.qualifier.zip is really not enough." (NOT :-) ) But maybe I am mistaken how the concrete filename would look like.

What would the concrete .zip file look like based on the example I defined in comment 4 ?
Comment 9 Tobias Oberlies CLA 2011-09-02 11:44:38 EDT
(In reply to comment #8)
> What would the concrete .zip file look like based on the example I defined in
> comment 4 ?
If your artifactId is org.eclipse.riena.repo and the unqualified version is 1.2.3.qualifier, and you use the default qualifier, the file would be called org.eclipse.riena.repo-1.2.3.201109021742.zip
Comment 10 Christian Campo CLA 2011-09-05 04:36:48 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > What would the concrete .zip file look like based on the example I defined in
> > comment 4 ?
> If your artifactId is org.eclipse.riena.repo and the unqualified version is
> 1.2.3.qualifier, and you use the default qualifier, the file would be called
> org.eclipse.riena.repo-1.2.3.201109021742.zip

That would be certainly better than a static filename. But not really the common practice at eclipse.org. Look at the download page of Eclipse http://download.eclipse.org/eclipse/downloads/drops4/M20110831-2000/index.php. These are milestone downloads. The download zip is i.e. eclipse-SDK-M20110831-2000-win32.zip. We like to do the same thing. How could you create such a filename with Tycho ?
Comment 11 Tobias Oberlies CLA 2011-09-05 05:24:15 EDT
For this, it would be necessary to have a parameter in the tycho-p2-director-plugin which maps ws/os/arch triples to archive names in the target directory.
In order to avoid name clashes, the archives should be each placed into a separate folder with ws/os/arch in the name. Would this be okay?
Comment 12 Michael Pellaton CLA 2012-03-31 08:35:43 EDT
Why not just add the configuration parameter <finalName> known from the tycho-packaging-plugin?

We are now mitigating this problem using the maven-assembly-plugin and just zip-up the entire ./target/repositoy again into another file named ${project.name}-${project.version}.zip
Comment 13 Michael Pellaton CLA 2012-04-14 03:39:15 EDT
Created attachment 214007 [details]
New parameter 'finalName' for the repo archive file name

[PATCH] 347416 New parameter 'finalName' for the repo archive file name 
- Add the parameter finalName to the Mojo 
- Use finalName as file name for the repository archive 
- Tycho491PublishFeaturesAndCategoriesTest now expects the project 
  version being part of the repository archive file name.
- Added test case bug347416_testFinalNameForRepositoryArchiveFile with a  
  custom finalName and asserts that check for the zip file being created   
  having that name
Comment 14 Michael Pellaton CLA 2012-04-14 03:42:18 EDT
And the legal stuff about the patch:
- Did you author 100% of the content you are contributing? YES
- Who owns the copyright of the contributed content? Me
- Is the contributed code licensed under the EPL? YES
- Do you have the right to contribute the content to Eclipse? YES
Comment 15 Jan Sievers CLA 2012-04-16 03:01:04 EDT
thanks for the patch and nice test case.
Will apply soon.
Comment 16 Jan Sievers CLA 2012-04-16 09:42:17 EDT
stripped down test case
https://git.eclipse.org/r/#/c/5593/
Comment 18 Michael Pellaton CLA 2012-04-19 14:43:21 EDT
Thanks for merging my patch!