ok here goes. this is my settings file
<settings>
<profiles>
<profile>
<id>inside</id>
<properties>
<repo>http://192.168.10.60:8080</repo>
</properties>
<repositories>
<repository>
<id>central</id>
<url>http://192.168.10.60:8080/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://192.168.10.60:8080/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
<profile>
<id>outside</id>
<properties>
<repo>http://repo1.company.com:8080</repo>
</properties>
<repositories>
<repository>
<id>central</id>
<url>http://repo1.company.com:8080/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://repo1.company.com:8080/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>inside</activeProfile>
</activeProfiles>
</settings>
the pom is as follows:
<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">
<parent>
<groupId>com.company.projects</groupId>
<artifactId>base-project</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.implementations.product.cs</groupId>
<artifactId>Implementation</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Implementation</name>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.company.product</groupId>
<artifactId>productCore</artifactId>
<version>3.0-SNAPSHOT</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
<!-- commons-logging 1.1. has invalid dependencies -->
<exclusions>
<exclusion>
<groupId>avalon-framework</groupId>
<artifactId>avalon-framework</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>logkit</groupId>
<artifactId>logkit</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.company.product</groupId>
<artifactId>miModel</artifactId>
<version>3.0-SNAPSHOT</version>
<outputDirectory>target/classes</outputDirectory>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
<version>1.1.3</version>
<configuration>
<directory>target/classes</directory>
<!-- multi-module>true</multi-module-->
<includes>
<includes>bindings-cs.xml</includes>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>bind</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
It is a child of the following pom - base project:
<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>com.company.projects</groupId>
<artifactId>base-project</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>base-project</name>
<url>http://project.projects.company.com</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
<buildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<buildcommand>com.genuitec.eclipse.hibernate.HibernateBuilder</buildcommand>
<buildcommand>com.genuitec.eclipse.springframework.springbuilder</buildcommand>
<buildcommand>org.maven.ide.eclipse.maven2Builder</buildcommand>
</buildcommands>
<projectnatures>
<projectnature>com.genuitec.eclipse.springframework.springnature</projectnature>
<projectnature>com.genuitec.eclipse.hibernate.hibernatenature</projectnature>
<projectnature>org.maven.ide.eclipse.maven2Nature</projectnature>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
</projectnatures>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>libs-releases</id>
<name>Releases</name>
<url>${repo}/artifactory/libs-releases</url>
</repository>
<snapshotRepository>
<id>libs-snapshots</id>
<name>Snapshots</name>
<url>${repo}/artifactory/libs-snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
So it all works if my repo has the base artifact. But it doesn't exist, I
get the following error when I try to run my project.
mvn -P outside jetty:run
[INFO] Scanning for projects...
Downloading:
http://192.168.10.60:8080/artifactory/repo/com/company/projects/base-project/1.0/base-project-1.0.pom
Downloading:
http://repo1.maven.org/maven2/com/company/projects/base-project/1.0/base-project-1.0.pom
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: com.company.projects
ArtifactId: base-project
Version: 1.0
Reason: Unable to download the artifact from any repository
com.company.projects:base-project:pom:1.0
from the specified remote repositories:
central (http://192.168.10.60:8080/artifactory/repo),
snapshots (http://192.168.10.60:8080/artifactory/repo)
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent:
com.company.projects:base-project for project:
com.company.product.rm:webrm:w
ar:0.2-SNAPSHOT for project com.company.product.rm:webrm:war:0.2-SNAPSHOT
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find
parent: com.company.projects:base-project for project: com.company.mire
v.rm:webrm:war:0.2-SNAPSHOT for project
com.company.product.rm:webrm:war:0.2-SNAPSHOT
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1261)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:747)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:479)
at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM
'com.company.projects:base-project' not found in repository: Unable to
download t
he artifact from any repository
com.company.projects:base-project:pom:1.0
from the specified remote repositories:
central (http://192.168.10.60:8080/artifactory/repo),
snapshots (http://192.168.10.60:8080/artifactory/repo)
for project com.company.projects:base-project
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:573)
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1257)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable to download the artifact from any repository
com.company.projects:base-project:pom:1.0
from the specified remote repositories:
central (http://192.168.10.60:8080/artifactory/repo),
snapshots (http://192.168.10.60:8080/artifactory/repo)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:197)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:73)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:526)
... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
download the artifact from any repository
at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:324)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:185)
... 20 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Fri Sep 28 05:33:13 EDT 2007
[INFO] Final Memory: 1M/2M
[INFO]
------------------------------------------------------------------------
Hope this info is enough. As you can clearly see, instead of going for the
outside profile, it takes the inside profile. Wonder why that happens.
When i try to get the effective settings, it fails again, because it is
trying to access the wrong url. i tried again, with just the base-project
installed, and it worked as expected. when the parent project is not found,
then it takes this behavior. Is this a bug?
--
View this message in context:
http://www.nabble.com/regarding-profiles-tf4532196s177.html#a12937523
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]