WSO2 samples Maven pom.xml - maven

I would like to package my project for wso2 into Maven, and first step is to place WSO2 samples into a maven build and then build upon that...however, not able to create pom.xml that will compile the sample code so far.
After following some trails online: WSO2 BAM 2.0 libraries in Maven
Which included downloading and installing a pom into local repository because it did not exist on wso2 repository, still getting errors...
Thanks for any assistance or best yet, if someone has a pom.xml for WSO2 samples and can share it...
Here is the current pom:
<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/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon</groupId>
<artifactId>carbon-components</artifactId>
<version>3.2.0</version>
</parent>
<repositories>
<repository>
<id>wso2-maven2-repository</id>
<name>WSO2 Maven2 Repository</name>
<url>http://dist.wso2.org/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
</repositories>
<modelVersion>4.0.0</modelVersion>
<groupId>acme</groupId>
<artifactId>acme.wso2</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.bam.agent</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>1.2.11</version>
</dependency>
</dependencies>
</project>
Here are the errors I receive on build:
c:\projects\acme.wso2> mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for acme:acme.wso2:jar:1.0-SNAPSHOT
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.wso2.carbon:org.wso2.carbon.core.common:jar -> duplicate declaration of version ${carbon.platform.version} # org.wso2.carbon:c
arbon-components:3.2.0, C:\Users\Tony\.m2\repository\org\wso2\carbon\carbon-components\3.2.0\carbon-components-3.2.0.pom, line 1025, column 25
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.wso2.carbon:org.wso2.carbon.mashup.jsservices.stub:jar -> duplicate declaration of version ${carbon.platform.version} # org.ws
o2.carbon:carbon-components:3.2.0, C:\Users\Tony\.m2\repository\org\wso2\carbon\carbon-components\3.2.0\carbon-components-3.2.0.pom, line 2128, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building acme.wso2 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for net.sf.saxon:saxon:jar:8.9 is missing, no dependency information available
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/eclipse/osgi/org.eclipse.osgi.services/3.2.0.v20
090520-1800/org.eclipse.osgi.services-3.2.0.v20090520-1800.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 8edc83998e0bf2a8867395883f3853eb901be267 for http://maven.wso2.org/nexus/content/groups/wso2-public/org/eclipse/osgi/org.eclipse.osgi.services/3.2.0.v20090520-1800/org.eclipse.osgi.services-3.2.0.v20090520-1800.pom
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/bsf/bsf-all/3.0/bsf-all-3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.956s
[INFO] Finished at: Thu Feb 07 16:43:12 EST 2013
[INFO] Final Memory: 12M/161M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project acme.wso2: Could not resolve dependencies for project acme:acme.wso2:jar:1.0-SNAPSHOT:
Failed to collect dependencies for [org.wso2.carbon:org.wso2.carbon.bam.agent:jar:3.2.4 (compile),
javax:javaee-api:jar:6.0 (provided),
org.apache.axis2:axis2:jar:1.5.1 (compile),
org.apache.ws.commons.axiom:axiom-api:jar:1.2.11 (compile)]:
Failed to read artifact descriptor for org.eclipse.osgi:org.eclipse.osgi.services:jar:3.2.0.v20090520-1800:
Could not transfer artifact org.eclipse.osgi:org.eclipse.osgi.services:pom:3.2.0.v20090520-1800 from/to wso2-nexus
(http://maven.wso2.org/nexus/content/groups/wso2-public/):
Checksum validation failed, expected <!DOCTYPE but is 8edc83998e0bf2a8867395883f3853eb901be267 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Can you build this pom file just like this,
mvn clean install -c
This will ignore the checkssum error.

Replace your repositories tag with the following. Your dependency will be available in one of these repositories. And if the checksum error seems to persists, please refer to #Harsha's answer.
<repositories>
<repository>
<id>wso2-nexus</id>
<name>WSO2 internal Repository</name>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
<repository>
<id>wso2.releases</id>
<name>WSO2 internal Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
<repository>
<id>wso2.snapshots</id>
<name>WSO2 Snapshot Repository</name>
<url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>

Related

mvn install package from GitHub package registry

I've followed steps given in this document to deploy a package on GitHub package registry, I'm able to successfully deploy a package. That can be seen here.
Now I'm trying to install this as a dependency in another project. As given in the above link I added this dependency in my pom file.
<dependency>
<groupId>com.github.ashishchopra/github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
Which obviously throws me this error:
[ERROR] 'dependencies.dependency.groupId' for com.github.ashishchopra/github_package_registry:group-upload.artifct-upload:jar with value 'com.github.ashishchopra/github_package_registry' does not match a valid id pattern.
Now I remove the part before / in the groupId and made dependency like this:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
Now I'm getting this error:
Downloading: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.275 s
[INFO] Finished at: 2019-10-10T19:47:42+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies
for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at github_package_registry:group-upload.artifct-upload:jar:0.0.1: Failed to read artifact descriptor for github_package_registry:group-upload.artifct-upload:jar:0.0.1: Could not transfer artifact github_package_registry:group-upload.artifct-upload:pom:0.0.1 from/to github (https://maven.pkg.github.com/ashishchopra): Failed to transfer file: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom. Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]
I also tried removing groupId. part from artifactId in dependency and made it like this:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
This time I'm getting this error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.417 s
[INFO] Finished at: 2019-10-10T19:52:08+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Could not find artifact github_package_registry:artifct-upload:jar:0.0.1 in central (https://repo1.maven.org/maven2) ->
[Help 1]
So with no combination, it seems to be working.
Content of my ~/.m2/settings.yml file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub ashishchopra Apache Maven Packages</name>
<url>https://maven.pkg.github.com/ashishchopra</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>ashishchopra</username>
<password>XXXX</password>
</server>
</servers>
These are direct steps from their documentation, nothing fancy, still, I'm not able to make it work.
In-fact pom and jar files are present at this link
https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/artifct-upload-0.0.1.pom
https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/artifct-upload-0.0.1.jar
As per the documentation you pointed to, the URL of the maven repository should include the name of your GitHub repository, i.e. github_package_registry. So that’s what you need in your settings.xml:
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/ashishchopra/github_package_registry</url>
</repository>
</repositories>
And in your pom.xml, just use the dependency described in your GitHub Packages page:
<dependency>
<groupId>group-upload</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
for some reason is not looking in the right repo, try to put this at the top of your settings.yml
<repository>
<id>github</id>
<name>GitHub ashishchopra Apache Maven Packages</name>
<url>https://maven.pkg.github.com/ashishchopra</url>
</repository>

maven dependancy lookup fails even if I have specified repo

I am trying to run a project. Its not able to find a dependency. So I have added repository inside pom.xml
But its not able to lookup for the same.
from pom.xml
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>spring</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://oss.sonatype.org/content/groups/public</url>
<layout>default</layout>
</repository>
</repositories>
81749 [WARNING] Unable to create Maven project for
com.gemstone.gemfire:gemfire:pom:8.1.0 from repository.
org.apache.maven.project.ProjectBuildingException: Error resolving
project artifact: Failure to find
com.gemstone.gemfire:gemfire:pom:8.1.0 in
https://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced for project
com.gemstone.gemfire:gemfire:pom:8.1.0
when i applied -X i see following
103850 [DEBUG] === PROJECT BUILD PLAN ================================================
103850 [DEBUG] Project: xxxxx:xxxxxx:0.0.1-SNAPSHOT
103850 [DEBUG] Dependencies (collect): [compile+runtime]
103850 [DEBUG] Dependencies (resolve): [compile, compile+runtime, runtime, test]
103850 [DEBUG] Repositories (dependencies): [central (https://repo.maven.apache.org/maven2, default, releases)]
103850 [DEBUG] Repositories (plugins) : [central (https://repo.maven.apache.org/maven2, default, releases)]
What am I missing here ? I have parent pom.xml with repository mention
parent is not included in child
Given this pom.xml:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>8.1.0</version>
</dependency>
</dependencies>
</project>
When I tried to run:
$mvn clean compile
The result was:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/com/gemstone/gemfire/gemfire/8.1.0/gemfire-8.1.0.pom
[WARNING] The POM for com.gemstone.gemfire:gemfire:jar:8.1.0 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/com/gemstone/gemfire/gemfire/8.1.0/gemfire-8.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.642 s
[INFO] Finished at: 2017-04-02T13:31:34+01:00
[INFO] Final Memory: 11M/131M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:0.1-SNAPSHOT: Could not find artifact com.gemstone.gemfire:gemfire:jar:8.1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
So I researched for the dependency and repository in mvnrepository.com and I found the repositories that contains this dependency are Spring Plugins and Spring Libs:
Then I just added the Spring Plugins repository in my pom and it worked!
The final POM is:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>8.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring</id>
<url>http://repo.spring.io/plugins-release</url>
</repository>
</repositories>
</project>

Using multiple repositories in maven cause download failure

I have som trouble when using multiple repositories in maven. Ass additinal information we use artifactory as local repository.
I have the following maven settings
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<username></username>
<password></password>
<id>central</id>
</server>
<server>
<username></username>
<password></password>
<id>snapshots</id>
</server>
<server>
<username></username>
<password></password>
<id>Dataproces</id>
</server>
<server>
<username></username>
<password></password>
<id>Dataproces-snapshot</id>
</server>
</servers>
<profiles>
<profile>
<id>artifactory</id>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>https://server/artifactory/libs-snapshot</url>
</repository>
<repository>
<id>Dataproces</id>
<name>Dataproces-releases</name>
<url>https://server/artifactory/libs-release-local</url>
</repository>
<!-----------PROBLEM------------>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>Dataproces-snapshot</id>
<name>Dataproces-snapshot</name>
<url>https://server/artifactory/libs-snapshot-local</url>
</repository>
<!-----------PROBLEM------------>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>https://server/artifactory/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>https://server02:8439/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>https://server02:8439/artifactory/pluginssnapshot</url>
</pluginRepository>
</pluginRepositories>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>
<!-- activeProfiles | List of profiles that are active for all builds. | -->
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
If I outcomment the "Dataproces-snapshot" it installs fine, but when I add the repository maven suddenly wont install, because of the missing pom. The error log :
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MinSagSilkeborg Controller 0.1
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://server02:8439/artifactory/libs-snapshot-local/dk/kmd/doc2mail/webservice/1/webservice-1.pom
[INFO] Downloading: https://server02:8439/artifactory/libs-snapshot-local/dk/kmd/doc2mail/jcommander/1/jcommander-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.401 s
[INFO] Finished at: 2016-04-06T11:47:03+02:00
[INFO] Final Memory: 15M/741M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MinSagSilkeborg-Controller: Could not resolve dependencies for project dk.dataproces.MinSagSilkeborg:MinSagSilkeborg-Controller:jar:0.1: Failed to collect dependencies at dk.kmd.doc2mail:webservice:jar:1: Failed to read artifact descriptor for dk.kmd.doc2mail:webservice:jar:1: Could not transfer artifact dk.kmd.doc2mail:webservice:pom:1 from/to Dataproces-snapshot (https://server/artifactory/libs-snapshot-local): Failed to transfer https://server/artifactory/libs-snapshot-local/dk/kmd/doc2mail/webservice/1/webservice-1.pom. Error code 409, Conflict -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
How come maven installs without any problem when the specified repository is outcommented ?
I know the pom file for the artifact is missing.

Maven ignores a repository

I'm unable to get Maven download an artifact
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
<version>1.1.9</version>
<scope>test</scope>
</dependency>
This dependency isn't in the Maven Central. I've added the proper repository to my settings.
<profiles>
<profile>
<id>barbucha</id>
</profile>
<repositories>
<repository>
<id>jboss</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-plug</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profiles>
Then I build things using the barbucha profile. However maven doesn't use the JBoss repository at all. It tries to get the missing dependency from Central instead. It tries to download the dependency twice and then fails:
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.pom
[WARNING] The POM for org.jboss.test-jsf:jsf-mock:jar:1.1.9 is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project: Could not resolve dependencies for project: Could not find artifact org.jboss.test-jsf:jsf-mock:jar:1.1.9 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
The behavior is very strange and sadly critical to me. I googled a long time, but nothing found, what can cause the problem. The only reason can be the profile if not activated. But that isn't my case.
Oh, it was so simple - my settings are just malformed:
<profiles>
<profile>
<id>barbucha</id>
</profile> <<< this must be at the end (at <!-- #1 --->)
<repositories>
... <!-- this part must be inside of profile -->
</pluginRepositories>
<!-- #1 --->
</profiles>
I apologize. (Hopefully it may help to someone.)

Why Maven wants to download ALL my dependecies from ALL my repostories?

My pom.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pw</groupId>
<artifactId>pocketwaitress-android</artifactId>
<name>PocketWaitress Android</name>
<packaging>apk</packaging>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>org.springframework.maven.snapshot</id>
<name>Spring Maven Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository><!-- For developing against latest Spring milestones -->
<repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<sdk>
<platform>7</platform>
<path>D:/WorkFolder/Android-SDK2</path>
</sdk>
<emulator>
<avd>WVGA-2.1</avd>
</emulator>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>false</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.android</groupId>
<artifactId>spring-android-rest-template</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.pw</groupId>
<artifactId>model</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.codehouse.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.9</version>
</dependency>
<dependency>
<groupId>org.codehouse.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.9</version>
</dependency>
</dependencies>
The latest addons to this are the Jackson dependecies.
The output of deploy is:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PocketWaitress Android 1.0
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/codehouse/jackson/jackson-core-asl/1.9.9/jackson-core-asl-1.9.9.pom
[WARNING] The POM for org.codehouse.jackson:jackson-core-asl:jar:1.9.9 is missing, no dependency information available
Downloading: http://repo1.maven.org/maven2/org/codehouse/jackson/jackson-mapper-asl/1.9.9/jackson-mapper-asl-1.9.9.pom
[WARNING] The POM for org.codehouse.jackson:jackson-mapper-asl:jar:1.9.9 is missing, no dependency information available
Downloading: http://repo1.maven.org/maven2/org/codehouse/jackson/jackson-core-asl/1.9.9/jackson-core-asl-1.9.9.jar
Downloading: http://repo1.maven.org/maven2/org/codehouse/jackson/jackson-mapper-asl/1.9.9/jackson-mapper-asl-1.9.9.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping PocketWaitress Android
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.313s
[INFO] Finished at: Wed Sep 12 12:50:48 CEST 2012
[INFO] Final Memory: 20M/174M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project pocketwaitress-android: Could not resolve dependencies for project com.pw:pocketwaitress-android:apk:1.0: The following artifacts could not be resolved: org.codehouse.jackson:jackson-core-asl:jar:1.9.9, org.codehouse.jackson:jackson-mapper-asl:jar:1.9.9: Failure to find org.codehouse.jackson:jackson-core-asl:jar:1.9.9 in http://maven.springframework.org/milestone was cached in the local repository, resolution will not be reattempted until the update interval of org.springframework.maven.milestone has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Apparently maven manages to download the jackson dependecies, from the central maven repository but then it tries to download them from http://maven.springframework.org/milestone too!
Why is that? Do i need to define somehow which dependencies are fetched from which repo? Makes no sense...
I've seen funky errors like this before and I usually do two things:
First, make sure your internet connection is working correctly - if Maven cannot connect to a particular repository, it will search additional repositories for the artifact and can potentially give misleading error messages (such as appearing to search the wrong repo).
Next, run your build again with the -U flag to force updates.
Again, not certain this is the problem, but I've seen similar behavior fixed by the above steps. Might be worth a shot.
Your jackson dependencies are not downloaded. When download is successful you will see something likeDownloaded: xyRecheck your dependencies.

Resources