Issue Details (XML | Word | Printable)

Key: MAVEN-835
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Alexey Krasnoriadtsev
Votes: 0
Watchers: 1
Operations

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

zip files don't go to maven.dependency.classpath

Created: 19/Sep/03 06:15 PM   Updated: 20/Jun/06 04:33 PM   Resolved: 24/Sep/03 01:56 AM
Component/s: None
Affects Version/s: 1.0-beta-10
Fix Version/s: 1.0-rc1

Time Tracking:
Not Specified

Issue Links:
Related
 


 Description  « Hide

[bp@octopus:test]$ cat project.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<id>test</id>
<dependencies>
<dependency>
<id>ant</id>
<version>1.5.3-1</version>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>classes12</artifactId>
<type>zip</type>
<version>9.2.0.3-1.2</version>
</dependency>
</dependencies>
</project>
[bp@octopus:test]$ !maven
maven -X
__ __

\/ __ Apache_ ___
  \/ / ` \ V / -) ' \ ~ intelligent projects ~
_   _,_ _/___ _ _ v. 1.0-beta-10

[DEBUG] Adding reference: maven.dependency.classpath -> /export/tools/maven-1.0-beta-10/repository/ant/jars/ant-1.5.3-1.jar
[DEBUG] Adding reference: maven-classpath ->
BUILD SUCCESSFUL
Total time: 7 seconds



Rafal Krzewski added a comment - 21/Sep/03 02:26 AM

This is correct behaviour. *.zip files are general purpose archives.
*.zip is no more related to Java classpath than *.foo. The solution
is to rename the driver archive to .jar in your local repository.


Alexey Krasnoriadtsev added a comment - 22/Sep/03 01:16 PM

.zip is the way Oracle and some other vendors distribute their libraries, renaming all of them every time the new version is out is a major pain, as well as a training issue for any new stuff that will be responsible for my project in the future.

Developers who write build scripts are smart enough to know what they are putting in the project.xml and what has to go on the classpath. If developer needs to put .ejb or even .foo on the classpath I see no problem with letting him do that. And then I also don't understand why is <type> in the project.xml is allowed to be different then .jar if only .jar goes to the classpath ?? What is the point of having any other type in dependency list if it's not used?

Thank you for your time.


Rafal Krzewski added a comment - 23/Sep/03 07:35 AM

<type> does more than just specyfing the artifact file extension.
It determines what kind of processing the artifact should recieve.
For example jar and ejb artifacts are added to the compilation classpath, and war and ear artifacts are not.
Doing what you ask for would either require adding all artifacts to
the classpath (which does not make sense, generally), or adding zip
type artifacts to the classpath, which also does not make sense for
a range of zip files (source distributions, javadocs etc).

There's another approach to solving your problem besides renaming the
files. Use <type>jar</type> to request correct handling, but override
the name of the file maven is looking for. I believe that you can do
it using <jar>...</jar> element. The downside is that you need to give
a complete name including the version into <jar/>. I don't use this
feature, and I'm not sure of the details.


Willie Vu added a comment - 24/Feb/04 02:37 AM

Using <type>jar</type> and <jar>...</jar> won't solve the problem because artifact directory is based on artifact type, i.e.

<maven local repository>/<type>s/<artifact name>