Issue Details (XML | Word | Printable)

Key: MPANT-24
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Arnaud Heritier
Reporter: Oscar Picasso
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Ant Plugin

Ant build.xml looking for dependenciesin several remote repositories

Created: 26/Feb/05 05:52 PM   Updated: 28/Feb/05 02:01 AM
Component/s: None
Affects Version/s: 1.8.1
Fix Version/s: 1.9

Time Tracking:
Not Specified

Environment: Any


 Description  « Hide
The generated ant build.xml only tries to download dependent jars from one remote repository.

It should also try to download from the alternate remote repositories in maven.repo.remote.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Arnaud Heritier added a comment - 26/Feb/05 08:05 PM
Not really easy to do.
Because of MPANT-20, we define a unique property for each dependency. Using several repositories will break it because we'll need to download several times the same dependency. We'll not be able to do it with a property (which is immutable).

What we can do easily is to provide a property which will allow the user to select the repository to use (and not the default ${maven.repo.remote}[0]). Can it help you ?


Oscar Picasso added a comment - 26/Feb/05 10:14 PM
> Can it help you ?

Not really because I use mostly ibiblio.

The other repository is just for jars that are not in ibiblio. A single project can depend on jars that are on both repositories.

Anyway I just use the ant build.xml to not disturb developers that don't still know maven. In the end I would prefer to work in an only maven environment.

So don't worry I can live with what we have now.

Thanks for trying.


Arnaud Heritier added a comment - 27/Feb/05 04:12 AM
I understand your problem.
Can't you create a private repository in your company with all jars that you need.
You can use maven proxy : http://maven-proxy.codehaus.org/

Oscar Picasso added a comment - 27/Feb/05 09:59 AM
Proxying would be the way to go in most cases.

However it won't work in my case. I am working on an open source project.

The 'specific' remote repository is simply hosted on sourceforge.

I don't have the luxury, at the moment, to setup a publicly available java application server for the proxy.


Arnaud Heritier added a comment - 27/Feb/05 12:48 PM
ok. I think I found a way to do it.
I'll warn you when it will be done.

Arnaud Heritier added a comment - 27/Feb/05 04:30 PM
Fixed.

Oscar Picasso added a comment - 27/Feb/05 06:51 PM
I tested your fix.

It works and can retrieves the jars from several repositories.

Some few comments below.

1- The generated build.xml script has the following lines:
<property name="proxy.host" value="${maven.proxy.host}">
</property>

In case you don't have set ${maven.proxy.host}, proxy.host is set to the string "${maven.proxy.host}" so the script is in "useProxy mode".

On execution of the script, ant complains with the following:

BUILD FAILED
<path-to-project>/build.xml:313: java.lang.NumberFormatException: For input string: "${maven.proxy.port}"

In order to succeed you have to explicitly set ${maven.proxy.port} to an empty string. Something like:

$ ant -Dmaven.proxy.host=

which is not something you should have to do.

My first impression is that the two lines that set proxy.host shouldn't be generated when maven.proxy.host is not set in maven.

2- Once the problem above corrected, the ant script execution produce several error messages like:

[get] Error opening connection java.io.FileNotFoundException...

It doesn't affect the final results. It doesn't mean that something really went wrong, just that some jars are not in some repositories which is expected.

Removing these pesky messages would be "la cerise sur le gāteau".

I'm not sure, though, if:

  • it's easy.
  • it's doable without removing the messages that need to remain (for example if all connection for a give jar failed).

In any case I really appreciate what you have done.

Oscar


Arnaud Heritier added a comment - 28/Feb/05 02:01 AM
  • Proxy settings :
    I found the problem. Personally my property "maven.proxy.host" is setted to an empty string in my ~/build.properties. It's why I didn't see this error. The problem is that ant doesn't replace unknow properties with an empty string or null (what Jelly does). I removed the default initialization for these properties (it's more annoying than useful).
  • Get dependencies
    Sorry but I can't give you "la cerise sur le gateau"
    These messages are provided by the get task in ant and I can't configure them.

I just publish a new snapshot and updated the staging site.