Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Maven import task not starting with startup trigger
Maven import task not starting with startup trigger [message #1730013] Wed, 20 April 2016 21:26 Go to next message
Heiko Stumpf is currently offline Heiko StumpfFriend
Messages: 1
Registered: April 2016
Junior Member
Hello everybody,

i have created my own project cataloge with the setup view including several "git clone" and one "maven import" task.
After the eclipse installation, the startup phase clones my git repos but the import of the maven projects does not happen. Instead, i need to run "Perform setup tasks" manually to trigger the maven import.
In the setup view the Maven import is listed for "startup trigger" and "manual trigger".

Why is the maven import not triggered after the git clone during the startup phase? What am i doing wrong?

Looking forward to your answers.

Heiko
Re: Maven import task not starting with startup trigger [message #1730171 is a reply to message #1730013] Fri, 22 April 2016 05:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Heiko,

The isNeeded test is like this:

public boolean isNeeded(SetupTaskContext context) throws Exception
{
EList<SourceLocator> sourceLocators = getSourceLocators();
if (sourceLocators.isEmpty())
{
return false;
}

if (context.getTrigger() != Trigger.MANUAL)
{
for (IProject project : ROOT.getProjects())
{
IPath projectFolder = project.getLocation();
for (SourceLocator sourceLocator : sourceLocators)
{
Path rootFolder = new Path(sourceLocator.getRootFolder());
if (rootFolder.isPrefixOf(projectFolder))
{
// In STARTUP trigger don't perform if there's already at
least 1 project from the source locators
return false;
}
}
}
}

return true;
}

So I imagine what you describe could be the case only if the workspace
isn't empty and has a project from one of your git clones already present.


On 21.04.2016 14:55, Heiko Stumpf wrote:
> Hello everybody,
>
> i have created my own project cataloge with the setup view including
> several "git clone" and one "maven import" task.
> After the eclipse installation, the startup phase clones my git repos
> but the import of the maven projects does not happen. Instead, i need
> to run "Perform setup tasks" manually to trigger the maven import.
> In the setup view the Maven import is listed for "startup trigger" and
> "manual trigger".
>
> Why is the maven import not triggered after the git clone during the
> startup phase? What am i doing wrong?
>
> Looking forward to your answers.
>
> Heiko


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Maven import task not starting with startup trigger [message #1733223 is a reply to message #1730171] Wed, 25 May 2016 07:03 Go to previous messageGo to next message
Leo Betz is currently offline Leo BetzFriend
Messages: 2
Registered: May 2016
Junior Member
Hello Ed,

I have the same problem.
The thing is that I have a subversion repo where I want to "Checkout as Maven Project" with Oomph.
Unfortunately there is no SVN checkout task so the only way I found is to use a Project Set Import Task to checkout the projects. But after that at least the root project is created in workspace and I don't know any way to prevent this.
So if I run the Maven Import Task afterwards it always skips because of the existing (non-maven) project.
Do you see any solution for this problem?
Is there a possibility to change the isNeeded() method in a way that it only looks on projects with activated Maven nature?

Regards
Leo
Re: Maven import task not starting with startup trigger [message #1733270 is a reply to message #1733223] Thu, 26 May 2016 03:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Leo,

Comments below.

On 25.05.2016 22:38, Leo Betz wrote:
> Hello Ed,
>
> I have the same problem.
> The thing is that I have a subversion repo where I want to "Checkout
> as Maven Project" with Oomph.
> Unfortunately there is no SVN checkout task so the only way I found is
> to use a Project Set Import Task to checkout the projects. But after
> that at least the root project is created in workspace and I don't
> know any way to prevent this.
I see. But all the task's isNeeded checks are done before any of them
are performed. So for this task, if the workspace is empty, as is the
case initially when creating a new installation for a Project setup, it
should return true.
> So if I run the Maven Import Task afterwards it always skips because
> of the existing (non-maven) project.
By after, you mean in the same Project setup as the one that contains
Project Set Import task? And that is doesn't perform during the
first/initial startup?
> Do you see any solution for this problem?
Is this a problem during initial startup?
> Is there a possibility to change the isNeeded() method in a way that
> it only looks on projects with activated Maven nature?
Perhaps, but I'm trying to understand why it's a problem at all. In
particular, why isn't the workspace empty initially when isNeeded is
tested the first time, which is even before the Project Set Import task
is performed.
>
> Regards
> Leo


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Maven import task not starting with startup trigger [message #1733769 is a reply to message #1733270] Tue, 31 May 2016 14:48 Go to previous messageGo to next message
Leo Betz is currently offline Leo BetzFriend
Messages: 2
Registered: May 2016
Junior Member
Hello Ed,

ok I see. So my problem is different:
The Maven Import Task is running.
But it skips projects that already exist in the workspace.
Of course, at least the root project exists after the project set import task. And so no maven nature is configured for that project.
What I need is a way to have the same final result as if I choose "Check out as Maven Project..." in SVN perspective.

Leo
Re: Maven import task not starting with startup trigger [message #1733775 is a reply to message #1733769] Tue, 31 May 2016 15:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Leo,

But the Maven import task itself does things like create the .project
file, so I'm not sure that makes sense in such a case. And of course
without specialized SVN integration, we can't replicate this "Check out
action"...


On 31.05.2016 16:48, Leo Betz wrote:
> Hello Ed,
>
> ok I see. So my problem is different:
> The Maven Import Task is running.
> But it skips projects that already exist in the workspace.
> Of course, at least the root project exists after the project set
> import task. And so no maven nature is configured for that project.
> What I need is a way to have the same final result as if I choose
> "Check out as Maven Project..." in SVN perspective.
>
> Leo


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Dynamic projects catalog
Next Topic:xtext create custom import wizard
Goto Forum:
  


Current Time: Fri Apr 19 05:35:05 GMT 2024

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

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

Back to the top