Maven 1

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

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.0-beta-10
  • Fix Version/s: 1.0-rc1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

[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

Issue Links

Activity

Hide
Rafal Krzewski added a comment -

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.

Show
Rafal Krzewski added a comment - 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.
Hide
Alexey Krasnoriadtsev added a comment -

.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.

Show
Alexey Krasnoriadtsev added a comment - .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.
Hide
Rafal Krzewski added a comment -

<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.

Show
Rafal Krzewski added a comment - <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.
Hide
Willie Vu added a comment -

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>

Show
Willie Vu added a comment - 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>

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: