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 brunee <br...@gmail.com> on 2008/07/21 07:53:28 UTC

.bundle extension in ivy retrieve... im so confused

Hi

I am trying to add the following dependency

        <dependency org="org.springframework.security"
name="spring-security-cas-client" rev="2.0.1" conf="compile->default">
             <exclude module="spring-dao-2.0.1"/>
             <exclude module="spring-tx-2.0.1"/>
             <exclude module="spring-jdbc-2.0.1"/>
             <exclude module="spring-beans-2.0.1"/>
             <exclude module="spring-dao-2.0.1"/>
             <exclude module="spring-support-2.0.1"/>
        </dependency>

but for some reason its looking for

[ivy:retrieve] 	
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.bundle

What is the .bundle?  Why is this jar dependency so special to all of
a sudden have a .bundle extesnion?

I am so confused??

Any ideas, anyone?

Re: .bundle extension in ivy retrieve... im so confused

Posted by rednix <ze...@gmx.de>.

Maarten Coene wrote:
> 
> I just did a quick test with current trunk, and it works form me.
> Could you try again with cleaning your cache: ${user.home}/.ivy2/
> 
> If that doesn't help, please create the JIRA ticket and also attach the
> debug output you get from ant.
> 
> Maarten
> 
> 

Looks like it's a problem with the proxy server we are using here at work. I
tried it at home (without any proxy) and it works fine - as you said.
The odd thing is that from the used resolver chain only the repository from
spring
(https://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo)
works via the proxy - all other resolvers in the chain are returning errors:

[ivy:install] :::: ERRORS
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.pom
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://www.mvnsearch.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://www.mvnsearch.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://mirrors.ibiblio.org/pub/mirrors/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://mirrors.ibiblio.org/pub/mirrors/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	Server access Error: Unexpected end of file from server
url=http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar

The detailed (debug/verbose) output says:

[ivy:install] :: installing
org.springframework.security#spring-security-cas-client;2.0.1 ::
[ivy:install] :: resolving dependencies ::
[ivy:install] resolving dependencies for configuration 'default'
[ivy:install] == resolving dependencies for apache#ivy-install;1.0 [default]
[ivy:install] loadData of apache#ivy-install;1.0 of rootConf=default
[ivy:install] == resolving dependencies
apache#ivy-install;1.0->org.springframework.security#spring-security-cas-client;2.0.1
[default->*]
[ivy:install] loadData of
org.springframework.security#spring-security-cas-client;2.0.1 of
rootConf=default
[ivy:install] 	using resolverChain to resolve
org.springframework.security#spring-security-cas-client;2.0.1
[ivy:install] pre 1.3 ivy file: using exactOrRegexp as default matcher
[ivy:install] 	found ivy file in cache for
org.springframework.security#spring-security-cas-client;2.0.1 (resolved by
resolverChain): C:\Documents and
Settings\[replaced]\.ivy2\cache\org.springframework.security\spring-security-cas-client\ivy-2.0.1.xml
[ivy:install] found module in cache but with a different resolver:
discarding: org.springframework.security#spring-security-cas-client;2.0.1;
expected resolver=ibiblio; resolver=resolverChain
[ivy:install] 	 trying
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.pom
[ivy:install] 		tried
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.pom
[ivy:install] ERROR: Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.pom
[ivy:install] 	ibiblio: resource not reachable for
org/springframework/security#spring-security-cas-client;2.0.1:
res=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.pom
[ivy:install] 	 trying
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 		tried
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] ERROR: Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	ibiblio: resource not reachable for
org/springframework/security#spring-security-cas-client;2.0.1:
res=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	ibiblio: no ivy file nor artifact found for
org.springframework.security#spring-security-cas-client;2.0.1
[ivy:install] pre 1.3 ivy file: using exactOrRegexp as default matcher
[ivy:install] 	found ivy file in cache for
org.springframework.security#spring-security-cas-client;2.0.1 (resolved by
resolverChain): C:\Documents and
Settings\[replaced]\.ivy2\cache\org.springframework.security\spring-security-cas-client\ivy-2.0.1.xml
[ivy:install] found module in cache but with a different resolver:
discarding: org.springframework.security#spring-security-cas-client;2.0.1;
expected resolver=repo1maven; resolver=resolverChain
[ivy:install] 	 trying
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 		tried
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] ERROR: Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 	repo1maven: resource not reachable for
org/springframework/security#spring-security-cas-client;2.0.1:
res=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-ivy.xml
[ivy:install] 	 trying
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 		tried
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] ERROR: Server access Error: Unexpected end of file from server
url=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	repo1maven: resource not reachable for
org/springframework/security#spring-security-cas-client;2.0.1:
res=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	 trying
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 		tried
http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	repo1maven: resource not reachable for
org/springframework/security#spring-security-cas-client;2.0.1:
res=http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.jar
[ivy:install] 	repo1maven: no ivy file nor artifact found for
org.springframework.security#spring-security-cas-client;2.0.1

w/o proxy from @home the dependencies are already found on ibiblio in the
chain. But why the POM from spring repo is not parsed correctly ... I don't
know. I'll try the spring repo explicitly @home later the day to check if
the POM there is correct.

Using just the ibiblio resolver instead of a resolverChain results in the
same errors (but the resolve is aborted without an artefact result and a
build error):

BUILD FAILED
C:\workspaces\eclipseEuropa\ivy-test\build.xml:118: Problem happened while
installing modules - see output for details
	at org.apache.ivy.ant.IvyInstall.doExecute(IvyInstall.java:113)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
	at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

My used ant target with the install task:

	<target name="copyToProject">
    	<ivy:install organisation="org.springframework.security"
module="spring-security-cas-client" revision="2.0.1" from="repo1maven"
to="my-repository" transitive="true" overwrite="true" />
	</target>

A little excerpt of the console log:

...
repo1maven: no namespace defined: using system
repo1maven: no latest strategy defined: using default
...
Setting project property: http.proxyHost -> [replaced].net
Setting project property: http.proxyHost.ivy.instance -> [replaced].net
Setting project property: file.encoding.ivy.instance -> Cp1252
Setting project property: https.proxyHost -> [replaced].net
Setting project property: https.proxyHost.ivy.instance -> [replaced].net
Setting project property: ivy.cache.dir -> C:\Documents and
Settings\[replaced]\.ivy2\cache
Setting project property: ivy.cache.dir.ivy.instance -> C:\Documents and
Settings\[replaced]\.ivy2\cache
Setting project property: https.proxyPort -> [replaced]
Setting project property: https.proxyPort.ivy.instance -> [replaced]
Setting project property: java.io.tmpdir.ivy.instance ->
C:\DOCUME~1\[replaced]\LOCALS~1\Temp\
Setting project property: ftp.proxyHost -> [replaced].net
Setting project property: ftp.proxyHost.ivy.instance -> [replaced].net
Setting project property: ftp.proxyPort -> [replaced]
Setting project property: ftp.proxyPort.ivy.instance -> [replaced]
Setting project property: http.proxyUser -> 
Setting project property: http.proxyUser.ivy.instance -> 
Setting project property: http.proxyPort -> [replaced]
Setting project property: http.proxyPort.ivy.instance -> [replaced]
Setting project property: http.proxyPassword -> 
Setting project property: http.proxyPassword.ivy.instance -> 
...
    default cache: C:\Documents and Settings\[replaced]\.ivy2\cache
    default resolver: ibiblio
    default latest strategy: latest-revision
    default conflict manager: latest-revision
    circular dependency strategy: warn
    validate: true
    check up2date: true
    -- 26 resolvers:
    repo1maven [url]
        cache: null
        m2compatible: true
        ivy patterns:
           
http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[module]-ivy.xml
        artifact patterns:
           
http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
           
http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
        repository: repo1maven
...

Clearing the local ivy cache folder doesn't help either. 
For other artifacts defined not as bundles the ibiblio etc. resolvers are
working fine via the proxy. So any idea what could be the reason for this
"Server access Error: Unexpected end of file from server"?
-- 
View this message in context: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-tp18562574p18891854.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: .bundle extension in ivy retrieve... im so confused

Posted by rednix <ze...@gmx.de>.
Yeah - thanks for your reply. Less chatter more productive work: I've added
the issue and attached my proposed patches. JIRA:
https://issues.apache.org/jira/browse/IVY-911
Hope the rest of the work (passing a new parameter) will not be a big deal
for you. Because I'm not familar with the way passing a ivy-config parameter
correctly to the invocing method...


Maarten Coene wrote:
> 
> The biggest chance of getting this fixed before 2.0 final is that you
> create a JIRA issue and attach a patch to it which makes the usage of HEAD
> configurable for both the standard URL handler as the commons-httpclient
> URL handler.
> If we need to make a 2.0-RC2 release, we can then apply your patch...
> 
> Maarten    
> 
> 

-- 
View this message in context: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-tp18562574p19551241.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: .bundle extension in ivy retrieve... im so confused

Posted by rednix <ze...@gmx.de>.
So  ... any news on this issue? It's still the same in RC1. Do I have to open
an JIIRA issue for this one? With the current code base ivy is not usable
from within our company proxy environment. Currently I have to build a
custom jar with the mentioned code line commented out to work. But that's
not satisfying. Even a configuration option would help like "use full
request method for retrieve for problematic/special proxies". Any chance to
get this fixed before going 2.0 final?

example code:

if (!config_use_full_request_method) {
    ((HttpURLConnection) con).setRequestMethod("HEAD");
}
-- 
View this message in context: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-tp18562574p19536241.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: .bundle extension in ivy retrieve... im so confused

Posted by rednix <ze...@gmx.de>.
Hi again,

I've done some more tests the last days. First I have to correct myself:
resolve doesn't work with "non-bundle-artifacts" either with the latest
trunk version (on our network where inet is accessible only via a corporate
proxy). I accidently missed to clear the local ivy cache for those tests. At
home I tried a random http proxy and strangly it worked fine. Then I tried
the spring repository (which was the only one that "worked" - but with a
defect ivy xml and missing dependencies - on our network) at home without a
proxy. The url to this repo is
https://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo/${ivy.shared.default.ivy.pattern}
The result was the same as at work: only the requested jar and an ivy xml
without dependencies and configurations. So I have to assume that this
repo/POM is not correct and always returns a false result.
The next thing I did was comparing the relevant code of ivy in the svn on
date where the ivy-2.0.0-alpha2-incubating.jar was built and the current one
(because using the old jar there is no problem resolving standard bundles in
our network via the proxy - of course the ones with .bundle doesn't work
because the fix is just available in the latest trunk). The relevant class
is org.apache.ivy.util.url.BasicURLHandler and the method is getURLInfo().
There were minimum changes but I found the one which causes the problem: on
line 64:

((HttpURLConnection) con).setRequestMethod("HEAD");

So the new code tries to make just a head request to retrieve the URL
information. That's fine because the full body is not transfered and
therefore there is less overhead. But in my scenario this doesn't work. When
I comment this line out - everything works fine with the resolve!! I did
some research about such a problem and proxy but with no usable result.
Unfortunately I'm not a networking / TCP/IP pro. Network sniffing via tools
like Wireshark are new to me and I have no access/control over the company's
proxy infrastructure. Maybe someone else has an idea what exactly is causing
this problem.


Maarten Coene wrote:
> 
> Very strange indeed, maybe the reason why the springframework repository
> works is that you use https for it, while for the other repositories you
> use http? Do you have the same proxy for http and https? (if not, maybe
> you hit issue IVY-200 ?)
> 
> But that doesn't explain why it works for the not "bundle-artifacts".
> 
> Maarten
> 
> 

-- 
View this message in context: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-tp18562574p18922701.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: .bundle extension in ivy retrieve... im so confused

Posted by rednix <ze...@gmx.de>.

Jim White wrote:
> 
> Maarten Coene wrote:
> 
>> This is a known bug in Ivy-2.0.0-beta2 and is fixed in SVN.
>> 
>> regards,
>> Maarten
> 
> And the workaround is to add an artifact element with ext='jar' to the 
> dependenency.
> 
>  From my post on 5/2:
> 
> http://marc.info/?l=ivy-user&m=120842825928326&w=2
> http://marc.info/?l=ivy-user&m=120842941430186&w=2
> 
> Add this within the <dependency> element:
> 
> <artifact name="spring-security-core" ext="jar"/>
> 
> Or in this case the name is "spring-security-cas-client".
> 
> Jim
> 
>> ----- Original Message ----
>> From: brunee <br...@gmail.com>
>> To: ivy-user@ant.apache.org
>> Sent: Monday, July 21, 2008 7:53:28 AM
>> Subject: .bundle extension in ivy retrieve... im so confused
>> 
>> Hi
>> 
>> I am trying to add the following dependency
>> 
>>         <dependency org="org.springframework.security"
>> name="spring-security-cas-client" rev="2.0.1" conf="compile->default">
>>              <exclude module="spring-dao-2.0.1"/>
>>              <exclude module="spring-tx-2.0.1"/>
>>              <exclude module="spring-jdbc-2.0.1"/>
>>              <exclude module="spring-beans-2.0.1"/>
>>              <exclude module="spring-dao-2.0.1"/>
>>              <exclude module="spring-support-2.0.1"/>
>>         </dependency>
>> 
>> but for some reason its looking for
>> 
>> [ivy:retrieve]     
>> http://repo1.maven.org/maven2/org/springframework/security/spring-security-cas-client/2.0.1/spring-security-cas-client-2.0.1.bundle
>> 
>> What is the .bundle?  Why is this jar dependency so special to all of
>> a sudden have a .bundle extesnion?
>> 
>> I am so confused??
>> 
>> Any ideas, anyone?
>> 
>> 
>> 
>>       
>> 
> 
> 
> 

I tried the latest trunk version from SVN (2.0.0-rc1-local-20080805174033)
and indeed - the jar from the bundle is now retrieved (and not
something.bundle as it was before). But unfortunately the corresponding
ivy-file is no longer correct. Every dependency is missing and the
configurations as well. The status attribute of the info-tag is "release"
but using the old ivy-2.0.0-alpha2-incubating.jar (where we got only
*.bundle but the ivy-file is ok) the status attribute says "integration".
The publication attribute differs as well. This is not only the case with
org.springframework.security / spring-security-cas-client but with every
artifacts defined as a bundle in public repositories.

Here are the two different ivy files for spring-security-cas-client 2.0.1:

using the old ivy-2.0.0-alpha2-incubating.jar:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
	<info organisation="org.springframework.security"
		module="spring-security-cas-client"
		revision="2.0.1"
		status="integration"
		publication="20080502153453"
	/>
	<configurations>
		<conf name="default" visibility="public" description="runtime dependencies
and master artifact can be used with this conf" extends="runtime,master"/>
		<conf name="master" visibility="public" description="contains only the
artifact published by this module itself, with no transitive dependencies"/>
		<conf name="compile" visibility="public" description="this is the default
scope, used if none is specified. Compile dependencies are available in all
classpaths."/>
		<conf name="provided" visibility="public" description="this is much like
compile, but indicates you expect the JDK or a container to provide it. It
is only available on the compilation classpath, and is not transitive."/>
		<conf name="runtime" visibility="public" description="this scope indicates
that the dependency is not required for compilation, but is for execution.
It is in the runtime and test classpaths, but not the compile classpath."
extends="compile"/>
		<conf name="test" visibility="private" description="this scope indicates
that the dependency is not required for normal use of the application, and
is only available for the test compilation and execution phases."/>
		<conf name="system" visibility="public" description="this scope is similar
to provided except that you have to provide the JAR which contains it
explicitly. The artifact is always available and is not looked up in a
repository."/>
	</configurations>
	<publications>
		<artifact name="spring-security-cas-client" type="bundle" ext="bundle"
conf="master"/>
	</publications>
	<dependencies>
		<dependency org="org.springframework.security" name="spring-security-core"
rev="2.0.1" force="true"
conf="compile->compile(*),master(*);runtime->runtime(*)"/>
		<dependency org="org.jasig.cas" name="cas-client-core" rev="3.1.1"
force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
	</dependencies>
</ivy-module>

using org.apache.ivy_2.0.0.rc1_20080805174033.jar:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
	<info organisation="org.springframework.security"
		module="spring-security-cas-client"
		revision="2.0.1"
		status="release"
		publication="20080806200914"
		default="true"
	/>
	<configurations>
		<conf name="default" visibility="public"/>
	</configurations>
	<publications>
		<artifact name="spring-security-cas-client" type="jar" ext="jar"
conf="default"/>
	</publications>
</ivy-module>

Currently I'm doing two resolves as a workaround: first one with the old jar
to get the correct ivy.xml and a second one using the new one to get the
jar. Then merging the good parts of the xmls to get the proper one. But this
is just annoying. I hope this will be fixed in the final. Should I open an
issue on the bugtracker for this?
-- 
View this message in context: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-tp18562574p18856965.html
Sent from the ivy-user mailing list archive at Nabble.com.