
Maven newbie here trying to convert my Eclipse project to Maven. I tried using the "version 99" of Commons Logging as documented here (so that I can use logback and slf4j instead): http://day-to-day-stuff.blogspot.com/2007/07/no-more-commons-logging.html which was just recently referenced on the logback mailing list. My pom.xml file starts out as below. Below that are the errors. So I don't understand why it's not working. And additionally in the errors part the initial "Downloading:" lines seem odd to me since they have the zapto url prepended to them. Help! Here's the top of the pom.xml file: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
<modelVersion>4.0.0</modelVersion> <groupId>people_locator</groupId> <artifactId>people_locator</artifactId> <packaging>war</packaging> <name>People Locator</name> <version>0.0.1-SNAPSHOT</version> <description /> <repositories> <repository> <id>Version99</id> <name>Version 99 Does Not Exist Maven repository</name> <layout>default</layout> <url>http://no-commons-logging.zapto.org/mvn2</url> </repository> </repositories> <dependencies> <!-- get empty jar instead of commons-logging --> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>99.0-does-not-exist</version> </dependency> <!-- no-commons-logging-api, if you need it --> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging-api</artifactId> <version>99.0-does-not-exist</version> </dependency> <!-- the slf4j commons-logging replacement --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl104-over-slf4j</artifactId> <version>1.4.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>1.5.2</version> </dependency> <!-- the other slf4j jars --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.4.2</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.9</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.5</version> </dependency> (rest omitted) Here are the errors I get from doing a maven compile (in eclipse): [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building People Locator [INFO] [INFO] Id: people_locator:people_locator:war:0.0.1-SNAPSHOT [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. url = http://no-commons-logging.zapto.org/mvn2 Downloading: http://no-commons-logging.zapto.org/mvn2/javax/transaction/jta/1.0.1B/jta-1.... url = http://repo1.maven.org/maven2 Downloading: http://repo1.maven.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar url = http://no-commons-logging.zapto.org/mvn2 Downloading: http://no-commons-logging.zapto.org/mvn2/org/jasig/cas/cas-client/3.1.3/cas-... url = http://repo1.maven.org/maven2 Downloading: http://repo1.maven.org/maven2/org/jasig/cas/cas-client/3.1.3/cas-client-3.1.... url = http://no-commons-logging.zapto.org/mvn2 Downloading: http://no-commons-logging.zapto.org/mvn2/org/springframework/security/spring... url = http://repo1.maven.org/maven2 Downloading: http://repo1.maven.org/maven2/org/springframework/security/spring-security-a... url = http://no-commons-logging.zapto.org/mvn2 Downloading: http://no-commons-logging.zapto.org/mvn2/org/springframework/security/spring... url = http://repo1.maven.org/maven2 Downloading: http://repo1.maven.org/maven2/org/springframework/security/spring-security-c... url = http://no-commons-logging.zapto.org/mvn2 Downloading: http://no-commons-logging.zapto.org/mvn2/org/springframework/security/spring... url = http://repo1.maven.org/maven2 Downloading: http://repo1.maven.org/maven2/org/springframework/security/spring-security-c... [ERROR] Transitive dependency resolution for scope: compile has failed for your project. Error message: Missing: ---------- 1) javax.transaction:jta:jar:1.0.1B Try downloading the file manually from: http://java.sun.com/products/jta Then, install it using the command: mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) people_locator:people_locator:war:0.0.1-SNAPSHOT 2) org.hibernate:hibernate:jar:3.2.6.ga 3) javax.transaction:jta:jar:1.0.1B 2) org.jasig.cas:cas-client:jar:pom:3.1.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.jasig.cas -DartifactId=cas-client -Dversion=3.1.3 -Dclassifier=pom -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.jasig.cas -DartifactId=cas-client -Dversion=3.1.3 -Dclassifier=pom -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) people_locator:people_locator:war:0.0.1-SNAPSHOT 2) org.jasig.cas:cas-client:jar:pom:3.1.3 3) org.springframework.security:spring-security-acl:jar:bundle:2.0.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.springframework.security -DartifactId=spring-security-acl -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.springframework.security -DartifactId=spring-security-acl -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) people_locator:people_locator:war:0.0.1-SNAPSHOT 2) org.springframework.security:spring-security-acl:jar:bundle:2.0.3 4) org.springframework.security:spring-security-cas-client:jar:bundle:2.0.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.springframework.security -DartifactId=spring-security-cas-client -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.springframework.security -DartifactId=spring-security-cas-client -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) people_locator:people_locator:war:0.0.1-SNAPSHOT 2) org.springframework.security:spring-security-cas-client:jar:bundle:2.0.3 5) org.springframework.security:spring-security-core-tiger:jar:bundle:2.0.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.springframework.security -DartifactId=spring-security-core-tiger -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.springframework.security -DartifactId=spring-security-core-tiger -Dversion=2.0.3 -Dclassifier=bundle -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) people_locator:people_locator:war:0.0.1-SNAPSHOT 2) org.springframework.security:spring-security-core-tiger:jar:bundle:2.0.3 ---------- 5 required artifacts are missing. for artifact: people_locator:people_locator:war:0.0.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2), Version99 (http://no-commons-logging.zapto.org/mvn2) Group-Id: people_locator Artifact-Id: people_locator Version: 0.0.1-SNAPSHOT From file: C:\users\rusty\workspaces\peoplelocator\people_locator\pom.xml [INFO] ------------------------------------------------------------------------ [INFO] For more information, run with the -e flag [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILED [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4 seconds [INFO] Finished at: Wed Aug 20 09:22:49 PDT 2008 [INFO] Final Memory: 1M/10M [INFO] ------------------------------------------------------------------------

Hello Rusty, I don't think the problems you are facing have to do with version 99. Try using the regular commons-logging to get your code to build. You do not need to reference commons-logging directly because it will be pulled in by maven's transitive dependency rules. See below for an explanation. For example, depending on logback-classic version 0.9.9 will transitively pull-in slf4j-api version 1.5.2. Similarly, since spring 2.5.5 depends on commons-logging v1.1.1, declaring spring 2.5.5 will pull-in commons-logging v1.1.1. I beleive that log4j is declared as an optional dependency in spring v2.5.5 so you probably do not need to declare log4j nor log4j-over-slf4j as dependencies. However, I might be wrong on that last item. As for modules in the org.slf4j group, they are a;ways released at the same time. So if you declare a dependency for log4j-over-slf4j version X, make sure that if you declare slf4j-api as dependency, its version number is identical to X. HTH, ps: One last thing, avoid cross posting to multiple lists. :-) Rusty Wright wrote:
Maven newbie here trying to convert my Eclipse project to Maven.
I tried using the "version 99" of Commons Logging as documented here (so that I can use logback and slf4j instead):
http://day-to-day-stuff.blogspot.com/2007/07/no-more-commons-logging.html
which was just recently referenced on the logback mailing list.
My pom.xml file starts out as below. Below that are the errors.
So I don't understand why it's not working. And additionally in the errors part the initial "Downloading:" lines seem odd to me since they have the zapto url prepended to them.
Help!
-- Ceki Gülcü QOS.ch is looking to hire talented developers located in Switzerland. Please contact ceki@qos.ch for details.

Ok, thanks. I'm still trying to figure out what's wrong. I've got it down two. One of them I'm not even listing as a dependency. Ceki Gulcu wrote:
Hello Rusty,
I don't think the problems you are facing have to do with version 99. Try using the regular commons-logging to get your code to build. You do not need to reference commons-logging directly because it will be pulled in by maven's transitive dependency rules. See below for an explanation.
For example, depending on logback-classic version 0.9.9 will transitively pull-in slf4j-api version 1.5.2. Similarly, since spring 2.5.5 depends on commons-logging v1.1.1, declaring spring 2.5.5 will pull-in commons-logging v1.1.1. I beleive that log4j is declared as an optional dependency in spring v2.5.5 so you probably do not need to declare log4j nor log4j-over-slf4j as dependencies. However, I might be wrong on that last item.
As for modules in the org.slf4j group, they are a;ways released at the same time. So if you declare a dependency for log4j-over-slf4j version X, make sure that if you declare slf4j-api as dependency, its version number is identical to X.
HTH,
ps: One last thing, avoid cross posting to multiple lists. :-)
Rusty Wright wrote:
Maven newbie here trying to convert my Eclipse project to Maven.
I tried using the "version 99" of Commons Logging as documented here (so that I can use logback and slf4j instead):
http://day-to-day-stuff.blogspot.com/2007/07/no-more-commons-logging.html
which was just recently referenced on the logback mailing list.
My pom.xml file starts out as below. Below that are the errors.
So I don't understand why it's not working. And additionally in the errors part the initial "Downloading:" lines seem odd to me since they have the zapto url prepended to them.
Help!
participants (2)
-
Ceki Gulcu
-
Rusty Wright