Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » How to copy file to workspace
How to copy file to workspace [message #1702321] Tue, 21 July 2015 14:11 Go to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
Hi,

I've created a ProductCatalog to create my own eclipse product with a set of plugin and some preferences.
I would like to copy a file (archetypesInfo.xml) to workspace but I don't know what is the good variable to use. I've tried ${workspace.location} but that doesn't work for me.
The variable is required by the installer and is not used when eclipse start up.

How could I get the workspace location ? or how can I set an archetype catalogue ?

Thanks.
Re: How to copy file to workspace [message #1702350 is a reply to message #1702321] Tue, 21 July 2015 16:23 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Alexandre,

${workspace.location} generally refers to the (implied) "location" attribute of a SetupTask with the ID "workspace".
This task is typically the WorkspaceTask that's automatically triggered when you provision a (Project-) Stream. This
task is not triggered for Product-only installations, which has sometimes struck me as odd because the lack of a
WorkspaceTask means that at first startup time the Workspace Chooser dialog of the IDE comes up instead of just using my
existing WorkspaceLocationRule (see user.setup). Unfortunately it's not as easy as adding a WorkspaceTask to your
Product; it wouldn't work in a Product. I can't remember if there was a compelling reason to not support a WorkspaceTask
in Products; maybe Ed does...

The other day I helped myself with this task in my user.setup, but it would certainly also work in a Product:

<?xml version="1.0" encoding="UTF-8"?>
<setup:ResourceCreationTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
excludedTriggers="STARTUP MANUAL"
content="eclipse.preferences.version=1&#xD;&#xA;RECENT_WORKSPACES_PROTOCOL=3&#xD;&#xA;RECENT_WORKSPACES=${installation.location/ws|property}&#xD;&#xA;MAX_RECENT_WORKSPACES=10&#xD;&#xA;SHOW_WORKSPACE_SELECTION_DIALOG=false&#xD;&#xA;"
targetURL="configuration:/.settings/org.eclipse.ui.ide.prefs"/>

Note that:

1) The Bootstrap trigger is excluded.
2) The ${installation.location/ws|property} expression requires the latest Oomph version (or the property filter would
by interpreted as a path segment).

In any case you can do the following things *in* the started IDE:

1) Use ${osgi.instance.area} like all other System properties (have a look at Help -> Installation Details ->
Configuration).
2) Use "platform:/resource/..." URIs.

I hope that helps.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 21.07.2015 um 17:10 schrieb Delegue Alexandre:
> Hi,
> I've created a ProductCatalog to create my own eclipse product with a set of plugin and some preferences. I would like
> to copy a file (archetypesInfo.xml) to workspace but I don't know what is the good variable to use. I've tried
> ${workspace.location} but that doesn't work for me. The variable is required by the installer and is not used when
> eclipse start up.
> How could I get the workspace location ? or how can I set an archetype catalogue ?
> Thanks.


Re: How to copy file to workspace [message #1702450 is a reply to message #1702350] Wed, 22 July 2015 12:37 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
Hi,

I'am using the installer version 1.1.0.Build 1516 and on the variable ${installation.location/ws|property} the property is evaluated to a path segment.
Is there a newest version ?

Thanks,
Alexandre
Re: How to copy file to workspace [message #1702457 is a reply to message #1702450] Wed, 22 July 2015 12:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.07.2015 um 14:37 schrieb Delegue Alexandre:
> Hi,
> I'am using the installer version 1.1.0.Build 1516 and on the variable ${installation.location/ws|property} the
> property is evaluated to a path segment.
Have you removed the two VariableTasks as I recommended?

> Is there a newest version ?
The newest nightly builds are available via https://wiki.eclipse.org/Eclipse_Installer

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to copy file to workspace [message #1702464 is a reply to message #1702457] Wed, 22 July 2015 13:36 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
Which VariableTasks are you talking about ?

I have something like this :

<setupTask
xsi:type="setup:ResourceCopyTask"
excludedTriggers="STARTUP MANUAL"
sourceURL="http://localhost/catalogue-eclipse/archetypesInfo.xml"
targetURL="${installation.location/ws|property}/.metadata/.plugins/org.eclipse.m2e.core">
</setupTask>
Re: How to copy file to workspace [message #1702501 is a reply to message #1702464] Wed, 22 July 2015 18:23 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.07.2015 um 15:36 schrieb Delegue Alexandre:
> Which VariableTasks are you talking about ?
Sorry, I confused your question with Joerg's recent question. Just forget about it.

> I have something like this :
> <setupTask
> xsi:type="setup:ResourceCopyTask"
> excludedTriggers="STARTUP MANUAL"
> sourceURL="http://localhost/catalogue-eclipse/archetypesInfo.xml"
> targetURL="${installation.location/ws|property}/.metadata/.plugins/org.eclipse.m2e.core">
> </setupTask>

Only the most recent nightly builds support variable filters *after* path extensions. So please use an installer from
https://wiki.eclipse.org/Eclipse_Installer and it should probably work.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to copy file to workspace [message #1702693 is a reply to message #1702501] Fri, 24 July 2015 07:34 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
Hi,

It work with ${installation.location|property}/.metadata/.plugins/org.eclipse.m2e.core but not with ${installation.location/ws|property}/.metadata/.plugins/org.eclipse.m2e.core
In your sample your workspace location is on the installation folder ?
The user preference tasks will create file on the workspace is possible to user that to create the file ${WORKSPACE}/.metadata/.plugins/org.eclipse.m2e.core/archetypesInfo.xml with the xml content ?

Cheers
Alex
Re: How to copy file to workspace [message #1702696 is a reply to message #1702693] Fri, 24 July 2015 07:52 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.07.2015 um 09:34 schrieb Delegue Alexandre:
> Hi,
> It work with ${installation.location|property}/.metadata/.plugins/org.eclipse.m2e.core but not with
> ${installation.location/ws|property}/.metadata/.plugins/org.eclipse.m2e.core
> In your sample your workspace location is on the installation folder ? The user preference tasks will create file on
> the workspace is possible to user that to create the file
> ${WORKSPACE}/.metadata/.plugins/org.eclipse.m2e.core/archetypesInfo.xml with the xml content ?
What build number is displayed in your installer?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to copy file to workspace [message #1702701 is a reply to message #1702696] Fri, 24 July 2015 08:17 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
1.1.0.Build 1516
it's a windows 32 installer
Re: How to copy file to workspace [message #1702707 is a reply to message #1702701] Fri, 24 July 2015 08:33 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.07.2015 um 10:17 schrieb Delegue Alexandre:
> 1.1.0.Build 1516 it's a windows 32 installer
That's what I supected. Now I'm forced to tell you the third time that you need to update to a newer build from
https://wiki.eclipse.org/Eclipse_Installer to be able to correctly interpret ${installation.location/ws|property}, i.e.,
a variable name that's *first* extended and *then* filtered. The newest build number is 1593.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to copy file to workspace [message #1702709 is a reply to message #1702707] Fri, 24 July 2015 08:56 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
I've understand that I've to download the last version from https://wiki.eclipse.org/Eclipse_Installer
but the last version for windows 32 installer is 1.1.0.Build 1516 and not 1593.
It's the same for windows 64 bit.
Is there another way to get the 1593 build for windows ?
Re: How to copy file to workspace [message #1702717 is a reply to message #1702709] Fri, 24 July 2015 09:30 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.07.2015 um 10:57 schrieb Delegue Alexandre:
> I've understand that I've to download the last version from https://wiki.eclipse.org/Eclipse_Installer but the last
> version for windows 32 installer is 1.1.0.Build 1516 and not 1593. It's the same for windows 64 bit.
I've tried it and you're right! I was confused about a recent change in our promotion policy. We used to serve nightly
builds from our wiki page but since a while we changed that to only milestone builds. I've just kicked a new milestone
build, which is ready now for you. Sorry that I was bitchy with you ;-)

> Is there another way to get the 1593 build for windows ?
I also added a new FAQ entry:
https://wiki.eclipse.org/Eclipse_Oomph_FAQ#How_can_I_update_the_installer_to_the_newest_nightly_build.3F

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: How to copy file to workspace [message #1702722 is a reply to message #1702717] Fri, 24 July 2015 09:44 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
thanks !
I will try this !

Alex.
Re: How to copy file to workspace [message #1702793 is a reply to message #1702722] Fri, 24 July 2015 15:10 Go to previous messageGo to next message
Delegue Alexandre is currently offline Delegue AlexandreFriend
Messages: 8
Registered: July 2015
Junior Member
Hi,

The evaluation of the variable ${installation.location/ws|property} work with the newest version of the installer.
But this do not create the file in my workspace if my workspace is not created in the location "installation.location/ws".
I've tried with a workspace task and the variable ${workspace.location}. This work but not if I switch or create a new workspace.

I want to create an eclipse product that set the preferences each time a user create workspace.
Is there a task that i could use wich is triggered when eclipse start up and not when I build the product from the installer ?

Thanks,
Alex.

Re: How to copy file to workspace [message #1702893 is a reply to message #1702793] Mon, 27 July 2015 09:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Alex,

Comments below.

On 24/07/2015 5:10 PM, Delegue Alexandre wrote:
> Hi,
> The evaluation of the variable ${installation.location/ws|property}
> work with the newest version of the installer. But this do not create
> the file in my workspace if my workspace is not created in the
> location "installation.location/ws".
> I've tried with a workspace task and the variable
> ${workspace.location}. This work but not if I switch or create a new
> workspace.
Is that perhaps because you've got excludedTriggers="STARTUP MANUAL" for
the task, i.e., that it's only done during bootstrap?
> I want to create an eclipse product that set the preferences each time
> a user create workspace. Is there a task that i could use wich is
> triggered when eclipse start up and not when I build the product from
> the installer ?
> Thanks, Alex.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to copy file to workspace [message #1732703 is a reply to message #1702893] Thu, 19 May 2016 10:24 Go to previous message
Michael Vorburger is currently offline Michael VorburgerFriend
Messages: 103
Registered: July 2009
Senior Member
Slightly off topic, but commenting here because I found this thread while searching for "Oomph M2E Maven archetypes archetype-catalog.xml" (<= Google, index this!), this is handy:

<setupTask
xsi:type="setup:ResourceCreationTask"
content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&lt;archetypeCatalogs>&lt;catalog type=&quot;remote&quot; location=&quot;http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml&quot; description=&quot;OpenDaylight.org (SNAPSHOT)&quot;/>&lt;/archetypeCatalogs>"
targetURL="${workspace.location|uri}/.metadata/.plugins/org.eclipse.m2e.core/archetypesInfo.xml"
encoding="UTF-8"/>

PS: Having https://bugs.eclipse.org/bugs/show_bug.cgi?id=493992 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=493991 (in M2E, not Oomph) would make it even cooler.

[Updated on: Thu, 19 May 2016 10:18]

Report message to a moderator

Previous Topic:Access unhashed value of password field
Next Topic:Lock workspace to installation
Goto Forum:
  


Current Time: Thu Apr 25 10:17:42 GMT 2024

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

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

Back to the top