You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by pa...@targetgroup.net on 2008/12/02 16:22:17 UTC

Refactoring code in dependent projects




I have this scenario. Project A depends on Project B

Before using Ivy I would have Project A and B in my Eclipse workspace, and
A would have B as a project on the Build Path.

This meant that if I refactored something in B (e.g. rename a service) it
would update references to it in A.

Now I am using Ivy B ends up being a JAR, I publish it to a repository and
then add a dependency to A's ivy.xml. This is fine, as A now relies on a
version or latest.integration jar of B.

But what if I am working on A and B at the same time and want to rename a
service in B ? Do I just rename it in B, publish it, and then manually
rename it in A ? Is there a smarter solution ?




Target
www.targetgroup.net
 
Target is a trading name of Target Group Limited, 
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

RE: Refactoring code in dependent projects

Posted by "Goldspink, Matt (IT)" <Ma...@morganstanley.com>.
If you close a project then you will need to re-resolve the dependent. Fortunately there's a button on the top tool bar which will perform a re-resolve across all projects. I should point out that the feature is still experimental according to the IvyDE developers but our team has been using it for 5-6 months without issues.

Matt

-----Original Message-----
From: Jim Adams [mailto:Jim.Adams@sas.com]
Sent: 02 December 2008 16:28
To: ivy-user@ant.apache.org
Subject: RE: Refactoring code in dependent projects

What if you have those 10-12 interdependent projects but only want to have a few of them open? Can you handle that? Ie, a->b->c but you only have a and c open?

> -----Original Message-----
> From: Goldspink, Matt (IT) [mailto:Matthew.Goldspink@morganstanley.com]
> Sent: Tuesday, December 02, 2008 11:14 AM
> To: ivy-user@ant.apache.org
> Subject: RE: Refactoring code in dependent projects
>
> There's a new feature coming in the next release of IvyDE 2.0.0.beta1 for Eclipse which allows you to resolve
> any matching projects in your Eclipse workspace. We've been building it from source and using it in our team
> where we have 10-12 interdependent projects and it's been working well for us.
>
> Matt
>
> -----Original Message-----
> From: paul.newport@targetgroup.net [mailto:paul.newport@targetgroup.net]
> Sent: 02 December 2008 15:56
> To: ivy-user@ant.apache.org
> Subject: RE: Refactoring code in dependent projects
>
>
>
>
>
>
> "What I did to solve the problem is: Setting the Eclipse Project
> dependencies (as without ivy) B -> A. Now you have the 'problem' that the
> projects are added twice (Ivy Managed Dependencies and Eclipse Project
> dependencies), but on the project Build Path you can adjust the order so
> that the workspace project is above the ivy managed dependencies.
> That works for me (including workspace modifications and compilation)."
>
> Thanks for that. So obvious in hindsight !
>
>
>
> Target
> www.targetgroup.net
>
> Target is a trading name of Target Group Limited,
> registered in England and Wales No. 1208137
> Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU
>
> **********************************************************************
> DISCLAIMER.
> This message is intended only for the use of the Addressee and may
> contain information that is PRIVILEGED and CONFIDENTIAL.
> If you are not the intended recipient you must not copy,
> distribute or take any action or reliance upon it.
> The content of this message may also contain personal
> views of an employee of this company and does
> not necessarily represent the view of the company.
> **********************************************************************
> This message has been scanned by Norton Anti-Virus.
> It has also been scanned by MAILsweeper to enforce our e-mail
> policy. If you have any concerns or comments about the content
> of this message, please  e-mail support@targetgroup.net.
> **********************************************************************
>
>
> _____________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality
> or privilege. Use of this email is prohibited when received in error.
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

RE: Refactoring code in dependent projects

Posted by Jim Adams <Ji...@sas.com>.
What if you have those 10-12 interdependent projects but only want to have a few of them open? Can you handle that? Ie, a->b->c but you only have a and c open?

> -----Original Message-----
> From: Goldspink, Matt (IT) [mailto:Matthew.Goldspink@morganstanley.com]
> Sent: Tuesday, December 02, 2008 11:14 AM
> To: ivy-user@ant.apache.org
> Subject: RE: Refactoring code in dependent projects
>
> There's a new feature coming in the next release of IvyDE 2.0.0.beta1 for Eclipse which allows you to resolve
> any matching projects in your Eclipse workspace. We've been building it from source and using it in our team
> where we have 10-12 interdependent projects and it's been working well for us.
>
> Matt
>
> -----Original Message-----
> From: paul.newport@targetgroup.net [mailto:paul.newport@targetgroup.net]
> Sent: 02 December 2008 15:56
> To: ivy-user@ant.apache.org
> Subject: RE: Refactoring code in dependent projects
>
>
>
>
>
>
> "What I did to solve the problem is: Setting the Eclipse Project
> dependencies (as without ivy) B -> A. Now you have the 'problem' that the
> projects are added twice (Ivy Managed Dependencies and Eclipse Project
> dependencies), but on the project Build Path you can adjust the order so
> that the workspace project is above the ivy managed dependencies.
> That works for me (including workspace modifications and compilation)."
>
> Thanks for that. So obvious in hindsight !
>
>
>
> Target
> www.targetgroup.net
>
> Target is a trading name of Target Group Limited,
> registered in England and Wales No. 1208137
> Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU
>
> **********************************************************************
> DISCLAIMER.
> This message is intended only for the use of the Addressee and may
> contain information that is PRIVILEGED and CONFIDENTIAL.
> If you are not the intended recipient you must not copy,
> distribute or take any action or reliance upon it.
> The content of this message may also contain personal
> views of an employee of this company and does
> not necessarily represent the view of the company.
> **********************************************************************
> This message has been scanned by Norton Anti-Virus.
> It has also been scanned by MAILsweeper to enforce our e-mail
> policy. If you have any concerns or comments about the content
> of this message, please  e-mail support@targetgroup.net.
> **********************************************************************
>
>
> _____________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality
> or privilege. Use of this email is prohibited when received in error.


RE: Refactoring code in dependent projects

Posted by pa...@targetgroup.net.




"There's a new feature coming in the next release of IvyDE 2.0.0.beta1 for
Eclipse which allows you to resolve any matching projects in your Eclipse
workspace. We've been building it from source and using it in our team
where we have 10-12 interdependent projects and it's been working well for
us."

Is there a latest build of the beta available for download ?

I've tried checking out the trunk from subversion, and doing:

ant -DbaseLocation="C:\eclipse-jee-europa-winter-win32\eclipse"

which is what I assume you do to build it, and I'm getting compile errors,
namely:

22. ERROR in
C:\downloads\ivydedown\ivyde-trunk\work\eclipse\plugins\org.apache.ivyde.eclipse\src\java\org\apache\ivyde\eclipse\cpcontainer\IvyClasspathContainerConfiguration.java
 (at line 492)

ivySettings.setBaseDir(javaProject.getProject().getLocation().toFile());
                  ^^^^^^^^^^
The method setBaseDir(File) is undefined for the type IvySettings
----------
23. ERROR in
C:\downloads\ivydedown\ivyde-trunk\work\eclipse\plugins\org.apache.ivyde.eclipse\src\java\org\apache\ivyde\eclipse\cpcontainer\IvyClasspathContainerConfiguration.java
 (at line 529)

ivySettings.setBaseDir(javaProject.getProject().getLocation().toFile());
                  ^^^^^^^^^^
The method setBaseDir(File) is undefined for the type IvySettings



Target
www.targetgroup.net
 
Target is a trading name of Target Group Limited, 
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

RE: Refactoring code in dependent projects

Posted by pa...@targetgroup.net.




Superb, thanks for that !



                                                                           
             "Goldspink, Matt                                              
             \(IT\)"                                                       
             <Matthew.Goldspin                                          To 
             k@morganstanley.c         <iv...@ant.apache.org>           
             om>                                                        cc 
                                                                           
             02/12/2008 16:14                                      Subject 
                                       RE: Refactoring code in dependent   
                                       projects                            
             Please respond to                                             
             ivy-user@ant.apac                                             
                  he.org                                                   
                                                                           
                                                                           
                                                                           




There's a new feature coming in the next release of IvyDE 2.0.0.beta1 for
Eclipse which allows you to resolve any matching projects in your Eclipse
workspace. We've been building it from source and using it in our team
where we have 10-12 interdependent projects and it's been working well for
us.

Matt

-----Original Message-----
From: paul.newport@targetgroup.net [mailto:paul.newport@targetgroup.net]
Sent: 02 December 2008 15:56
To: ivy-user@ant.apache.org
Subject: RE: Refactoring code in dependent projects






"What I did to solve the problem is: Setting the Eclipse Project
dependencies (as without ivy) B -> A. Now you have the 'problem' that the
projects are added twice (Ivy Managed Dependencies and Eclipse Project
dependencies), but on the project Build Path you can adjust the order so
that the workspace project is above the ivy managed dependencies.
That works for me (including workspace modifications and compilation)."

Thanks for that. So obvious in hindsight !



Target
www.targetgroup.net

Target is a trading name of Target Group Limited,
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL.
If you are not the intended recipient you must not copy,
distribute or take any action or reliance upon it.
The content of this message may also contain personal
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus.
It has also been scanned by MAILsweeper to enforce our e-mail
policy. If you have any concerns or comments about the content
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does
not intend to waive confidentiality or privilege. Use of this email is
prohibited when received in error.

_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System.



_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

RE: Refactoring code in dependent projects

Posted by "Goldspink, Matt (IT)" <Ma...@morganstanley.com>.
There's a new feature coming in the next release of IvyDE 2.0.0.beta1 for Eclipse which allows you to resolve any matching projects in your Eclipse workspace. We've been building it from source and using it in our team where we have 10-12 interdependent projects and it's been working well for us.

Matt

-----Original Message-----
From: paul.newport@targetgroup.net [mailto:paul.newport@targetgroup.net]
Sent: 02 December 2008 15:56
To: ivy-user@ant.apache.org
Subject: RE: Refactoring code in dependent projects






"What I did to solve the problem is: Setting the Eclipse Project
dependencies (as without ivy) B -> A. Now you have the 'problem' that the
projects are added twice (Ivy Managed Dependencies and Eclipse Project
dependencies), but on the project Build Path you can adjust the order so
that the workspace project is above the ivy managed dependencies.
That works for me (including workspace modifications and compilation)."

Thanks for that. So obvious in hindsight !



Target
www.targetgroup.net

Target is a trading name of Target Group Limited,
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL.
If you are not the intended recipient you must not copy,
distribute or take any action or reliance upon it.
The content of this message may also contain personal
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus.
It has also been scanned by MAILsweeper to enforce our e-mail
policy. If you have any concerns or comments about the content
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

RE: Refactoring code in dependent projects

Posted by pa...@targetgroup.net.




"What I did to solve the problem is: Setting the Eclipse Project
dependencies (as without ivy) B -> A. Now you have the 'problem' that the
projects are added twice (Ivy Managed Dependencies and Eclipse Project
dependencies), but on the project Build Path you can adjust the order so
that the workspace project is above the ivy managed dependencies.
That works for me (including workspace modifications and compilation)."

Thanks for that. So obvious in hindsight !



Target
www.targetgroup.net
 
Target is a trading name of Target Group Limited, 
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com

RE: Refactoring code in dependent projects

Posted by Andreas Schläpfer <An...@crealogix.com>.
What I did to solve the problem is: Setting the Eclipse Project dependencies (as without ivy) B -> A. Now you have the 'problem' that the projects are added twice (Ivy Managed Dependencies and Eclipse Project dependencies), but on the project Build Path you can adjust the order so that the workspace project is above the ivy managed dependencies.
That works for me (including workspace modifications and compilation).

-----Original Message-----
From: paul.newport@targetgroup.net [mailto:paul.newport@targetgroup.net] 
Sent: Dienstag, 2. Dezember 2008 16:22
To: ivy-user@ant.apache.org
Subject: Refactoring code in dependent projects





I have this scenario. Project A depends on Project B

Before using Ivy I would have Project A and B in my Eclipse workspace, and
A would have B as a project on the Build Path.

This meant that if I refactored something in B (e.g. rename a service) it
would update references to it in A.

Now I am using Ivy B ends up being a JAR, I publish it to a repository and
then add a dependency to A's ivy.xml. This is fine, as A now relies on a
version or latest.integration jar of B.

But what if I am working on A and B at the same time and want to rename a
service in B ? Do I just rename it in B, publish it, and then manually
rename it in A ? Is there a smarter solution ?




Target
www.targetgroup.net
 
Target is a trading name of Target Group Limited, 
registered in England and Wales No. 1208137
Registered office:  Target House, Cowbridge Road East, Cardiff CF11 9AU

**********************************************************************
DISCLAIMER.
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
**********************************************************************
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail support@targetgroup.net.
**********************************************************************


_____________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com