[forge-users] MavenDependencyFacet.hasRepository

Lincoln Baxter, III lincolnbaxter at gmail.com
Tue Jan 17 12:03:15 EST 2012


Yep!

That's a bug: https://issues.jboss.org/browse/FORGE-433 (Just filed and
fixed.)

Thanks!
~Lincoln

On Tue, Jan 17, 2012 at 5:48 AM, Max Schwaab <max.schwaab at akquinet.de>wrote:

>  Hey there :)
>
> It's me again, I have a question about the hasRepository method in the
> MavenDependencyFacet.
>
> Why do you remove the repository if its found in the project pom?
> I expect the method to deliver true or false, not to manipulate the
> project pom.
>
> Is this a bug or something with another sense?
>
> Best regards
>
> Max
>
>  @Override
>    public boolean hasRepository(final String url)
>    {
>       if (url != null)
>       {
>          MavenCoreFacet maven = project.getFacet(MavenCoreFacet.class);
>          Model pom = maven.getPOM();
>          List<Repository> repositories = pom.getRepositories();
>          for (Repository repo : repositories)
>          {
>             if (repo.getUrl().trim().equals(url.trim()))
>             {
>               * repositories.remove(repo);
>                maven.setPOM(pom);*
>                return true;
>             }
>          }
>       }
>       return false;
>    }
>
> _______________________________________________
> forge-users mailing list
> forge-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-users
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-users/attachments/20120117/07bbbc42/attachment.html 


More information about the forge-users mailing list