You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andy Dingfelder <Di...@SirTrack.com> on 2007/08/30 00:31:09 UTC
cross platform pom
I have a pom that works on windows, but does not work if I use it on Linux because the paths are different, such as:
<dependency>
<groupId>com.toedter</groupId>
<artifactId>jcalendar</artifactId>
<version>1.2.2</version>
<scope>system</scope>
<systemPath>
C:/projects/java.3rdParty/jars/jcalendar-1.3.2.jar
</systemPath>
</dependency>
is there any way to use an environment variable for the start of the path or some other solution?
on Linux the path would be
<systemPath>
/home/myname/workspace/java.3rdParty/jars/jcalendar-1.3.2.jar
</systemPath>
I asked on the eclipse maven list and got this advice:
> Andy,
> check out what it says on the maven website:
> systemPath : is used only if the dependency scope is system .
> Otherwise, the build will fail if this element is set. The path must be
> absolute, so it is recommended to use a property to specify the
> machine-specific path (more on properties below), such as
> $java.home/lib . ........
> http://maven.apache.org/pom.html#Properties
I tried doing this and am getting the following error (below)
Perhaps the settings.xml file is not getting processed correctly?
How can I debug if the environment variable I am setting is getting read in correctly?
my settings.xml is /home/dingfelder/.m2/settings.xml and contains:
<settings>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault/>
</activation>
<properties>
<java-third-party.home>/home/dingfelder/workspace/java.3rdparty/jars/</java-third-party.home>
</properties>
</profile>
</profiles>
</settings>
the error is:
[DEBUG] Building Maven user-level plugin registry from: '/home/dingfelder/.m2/plugin-registry.xml'
[DEBUG] Building Maven user-level plugin registry from: '/home/dingfelder/.m2/plugin-registry.xml'
[INFO] Scanning for projects...
[ERROR] reactor-execute : /home/dingfelder/workspace/java.common
Diagnosis: Failed to validate POM
FATAL ERROR: Error executing Maven for a project
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.sirtrack:common_java
POM Location: /home/dingfelder/workspace/java.common/pom.xml
Validation Messages:
[0] For dependency Dependency {groupId=com.toedter, artifactId=jcalendar, version=1.2.2, type=jar}: system-scoped dependency must specify an absolute path systemPath.
Reason: Failed to validate POM
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace Failed to validate POM
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Aug 29 21:55:23 NZST 2007
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------
java.lang.NullPointerException
at org.apache.maven.DefaultMaven.logReactorSummary(DefaultMaven.java:611)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:130)
at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:531)
at org.maven.ide.eclipse.embedder.Maven2Executor.main(Maven2Executor.java:82)
thoughts?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: cross platform pom
Posted by Roland Asmann <Ro...@cfc.at>.
I know it's a little late, but I haven't seen an answer yet.... So here's my
solution:
Use a variable for the path (e.g. ${calendarJarPath}) and define 2 profiles
that are activated on 'os'. Then in those profiles you can define the correct
pahts on both systems.
Or, in case the paths differ per machine (like in my company), you don't
define profiles and expect the user to supply it at the commandline
(mvn -DcalendarJarPath=locationOfJar).
But I strongly suggest adding these JARs to a repository in your company and
not using the systemPath. The only JARs that, imo, should have the systemPath
are JDK/JRE.
On Thursday 30 August 2007 00:31, Andy Dingfelder wrote:
> I have a pom that works on windows, but does not work if I use it on Linux
> because the paths are different, such as:
>
> <dependency>
> <groupId>com.toedter</groupId>
> <artifactId>jcalendar</artifactId>
> <version>1.2.2</version>
> <scope>system</scope>
> <systemPath>
> C:/projects/java.3rdParty/jars/jcalendar-1.3.2.jar
> </systemPath>
> </dependency>
>
> is there any way to use an environment variable for the start of the path
> or some other solution?
>
> on Linux the path would be
>
> <systemPath>
> /home/myname/workspace/java.3rdParty/jars/jcalendar-1.3.2.jar
> </systemPath>
>
> I asked on the eclipse maven list and got this advice:
> > Andy,
> > check out what it says on the maven website:
> >
> > systemPath : is used only if the dependency scope is system .
> > Otherwise, the build will fail if this element is set. The path must be
> > absolute, so it is recommended to use a property to specify the
> > machine-specific path (more on properties below), such as
> > $java.home/lib . ........
> >
> > http://maven.apache.org/pom.html#Properties
>
> I tried doing this and am getting the following error (below)
>
> Perhaps the settings.xml file is not getting processed correctly?
>
> How can I debug if the environment variable I am setting is getting read in
> correctly?
>
> my settings.xml is /home/dingfelder/.m2/settings.xml and contains:
>
> <settings>
> <profiles>
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault/>
> </activation>
> <properties>
>
> <java-third-party.home>/home/dingfelder/workspace/java.3rdparty/jars/</java
>-third-party.home> </properties>
> </profile>
> </profiles>
> </settings>
>
> the error is:
>
> [DEBUG] Building Maven user-level plugin registry from:
> '/home/dingfelder/.m2/plugin-registry.xml' [DEBUG] Building Maven
> user-level plugin registry from: '/home/dingfelder/.m2/plugin-registry.xml'
> [INFO] Scanning for projects...
> [ERROR] reactor-execute : /home/dingfelder/workspace/java.common
> Diagnosis: Failed to validate POM
> FATAL ERROR: Error executing Maven for a project
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error building POM (may not be this project's POM).
>
> Project ID: com.sirtrack:common_java
> POM Location: /home/dingfelder/workspace/java.common/pom.xml
> Validation Messages:
>
> [0] For dependency Dependency {groupId=com.toedter,
> artifactId=jcalendar, version=1.2.2, type=jar}: system-scoped dependency
> must specify an absolute path systemPath.
>
> Reason: Failed to validate POM
>
> [INFO]
> ------------------------------------------------------------------------
> [DEBUG] Trace Failed to validate POM
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Wed Aug 29 21:55:23 NZST 2007
> [INFO] Final Memory: 1M/4M
> [INFO]
> ------------------------------------------------------------------------
> java.lang.NullPointerException
> at org.apache.maven.DefaultMaven.logReactorSummary(DefaultMaven.java:611)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:130)
> at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:531)
> at
> org.maven.ide.eclipse.embedder.Maven2Executor.main(Maven2Executor.java:82)
>
>
> thoughts?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
--
Roland Asmann
CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien
Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: cross platform pom
Posted by adam hardy <ad...@cyberspaceroad.com>.
Andy
are you having problems with the hsqldb dependency anymore?
I assume, since you haven't said otherwise, that you now get a "Unable
to get resource 'jcalendar-....etc' from repository". Is that correct?
Is anything working? Can you build any project successfully with maven?
Did you modify the settings.xml in .m2 or maven-2.0.7/conf ?
Did you override your repository location in a profile?
A likely cause might be intermittent interruptions of your internet
connection.
Is your .m2 directory on a local harddrive or is it shared / network?
Adam
Joshua ChaitinPollak wrote:
> I think what you want to do is install the dependency into your local
> repository on both Windows and Linux and then remove the <scope> and
> <systemPath> options from the pom.xml
>
> Something like this:
>
> http://maven.apache.org/plugins/maven-install-plugin/examples/specific-local-repo.html
>
>
> Use the same group and artifact ID you have specified in your pom.xml on
> the command line.
>
> -Josh
>
> On Aug 29, 2007, at 6:31 PM, Andy Dingfelder wrote:
>
>> I have a pom that works on windows, but does not work if I use it on
>> Linux because the paths are different, such as:
>>
>> <dependency>
>> <groupId>com.toedter</groupId>
>> <artifactId>jcalendar</artifactId>
>> <version>1.2.2</version>
>> <scope>system</scope>
>> <systemPath>
>> C:/projects/java.3rdParty/jars/jcalendar-1.3.2.jar
>> </systemPath>
>> </dependency>
>>
>> is there any way to use an environment variable for the start of the
>> path or some other solution?
>>
>> on Linux the path would be
>>
>> <systemPath>
>> /home/myname/workspace/java.3rdParty/jars/jcalendar-1.3.2.jar
>> </systemPath>
>>
>> I asked on the eclipse maven list and got this advice:
>>
>>> Andy,
>>> check out what it says on the maven website:
>>
>>> systemPath : is used only if the dependency scope is system .
>>> Otherwise, the build will fail if this element is set. The path must be
>>> absolute, so it is recommended to use a property to specify the
>>> machine-specific path (more on properties below), such as
>>> $java.home/lib . ........
>>
>>> http://maven.apache.org/pom.html#Properties
>>
>> I tried doing this and am getting the following error (below)
>>
>> Perhaps the settings.xml file is not getting processed correctly?
>>
>> How can I debug if the environment variable I am setting is getting
>> read in correctly?
>>
>> my settings.xml is /home/dingfelder/.m2/settings.xml and contains:
>>
>> <settings>
>> <profiles>
>> <profile>
>> <id>default</id>
>> <activation>
>> <activeByDefault/>
>> </activation>
>> <properties>
>>
>> <java-third-party.home>/home/dingfelder/workspace/java.3rdparty/jars/</java-third-party.home>
>>
>> </properties>
>> </profile>
>> </profiles>
>> </settings>
>>
>> the error is:
>>
>> [DEBUG] Building Maven user-level plugin registry from:
>> '/home/dingfelder/.m2/plugin-registry.xml'
>> [DEBUG] Building Maven user-level plugin registry from:
>> '/home/dingfelder/.m2/plugin-registry.xml'
>> [INFO] Scanning for projects...
>> [ERROR] reactor-execute : /home/dingfelder/workspace/java.common
>> Diagnosis: Failed to validate POM
>> FATAL ERROR: Error executing Maven for a project
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Error building POM (may not be this project's POM).
>>
>> Project ID: com.sirtrack:common_java
>> POM Location: /home/dingfelder/workspace/java.common/pom.xml
>> Validation Messages:
>>
>> [0] For dependency Dependency {groupId=com.toedter,
>> artifactId=jcalendar, version=1.2.2, type=jar}: system-scoped
>> dependency must specify an absolute path systemPath.
>>
>> Reason: Failed to validate POM
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [DEBUG] Trace Failed to validate POM
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: < 1 second
>> [INFO] Finished at: Wed Aug 29 21:55:23 NZST 2007
>> [INFO] Final Memory: 1M/4M
>> [INFO]
>> ------------------------------------------------------------------------
>> java.lang.NullPointerException
>> at
>> org.apache.maven.DefaultMaven.logReactorSummary(DefaultMaven.java:611)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:130)
>> at
>> org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:531)
>> at
>> org.maven.ide.eclipse.embedder.Maven2Executor.main(Maven2Executor.java:82)
>>
>>
>>
>> thoughts?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: cross platform pom
Posted by Joshua ChaitinPollak <jp...@kivasystems.com>.
I think what you want to do is install the dependency into your local
repository on both Windows and Linux and then remove the <scope> and
<systemPath> options from the pom.xml
Something like this:
http://maven.apache.org/plugins/maven-install-plugin/examples/
specific-local-repo.html
Use the same group and artifact ID you have specified in your pom.xml
on the command line.
-Josh
On Aug 29, 2007, at 6:31 PM, Andy Dingfelder wrote:
> I have a pom that works on windows, but does not work if I use it
> on Linux because the paths are different, such as:
>
> <dependency>
> <groupId>com.toedter</groupId>
> <artifactId>jcalendar</artifactId>
> <version>1.2.2</version>
> <scope>system</scope>
> <systemPath>
> C:/projects/java.3rdParty/jars/jcalendar-1.3.2.jar
> </systemPath>
> </dependency>
>
> is there any way to use an environment variable for the start of
> the path or some other solution?
>
> on Linux the path would be
>
> <systemPath>
> /home/myname/workspace/java.3rdParty/jars/jcalendar-1.3.2.jar
> </systemPath>
>
> I asked on the eclipse maven list and got this advice:
>
>> Andy,
>> check out what it says on the maven website:
>
>> systemPath : is used only if the dependency scope is system .
>> Otherwise, the build will fail if this element is set. The path
>> must be
>> absolute, so it is recommended to use a property to specify the
>> machine-specific path (more on properties below), such as
>> $java.home/lib . ........
>
>> http://maven.apache.org/pom.html#Properties
>
> I tried doing this and am getting the following error (below)
>
> Perhaps the settings.xml file is not getting processed correctly?
>
> How can I debug if the environment variable I am setting is getting
> read in correctly?
>
> my settings.xml is /home/dingfelder/.m2/settings.xml and contains:
>
> <settings>
> <profiles>
> <profile>
> <id>default</id>
> <activation>
> <activeByDefault/>
> </activation>
> <properties>
> <java-third-party.home>/home/dingfelder/workspace/java.
> 3rdparty/jars/</java-third-party.home>
> </properties>
> </profile>
> </profiles>
> </settings>
>
> the error is:
>
> [DEBUG] Building Maven user-level plugin registry from: '/home/
> dingfelder/.m2/plugin-registry.xml'
> [DEBUG] Building Maven user-level plugin registry from: '/home/
> dingfelder/.m2/plugin-registry.xml'
> [INFO] Scanning for projects...
> [ERROR] reactor-execute : /home/dingfelder/workspace/java.common
> Diagnosis: Failed to validate POM
> FATAL ERROR: Error executing Maven for a project
> [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] Error building POM (may not be this project's POM).
>
> Project ID: com.sirtrack:common_java
> POM Location: /home/dingfelder/workspace/java.common/pom.xml
> Validation Messages:
>
> [0] For dependency Dependency {groupId=com.toedter,
> artifactId=jcalendar, version=1.2.2, type=jar}: system-scoped
> dependency must specify an absolute path systemPath.
>
> Reason: Failed to validate POM
>
> [INFO]
> ----------------------------------------------------------------------
> --
> [DEBUG] Trace Failed to validate POM
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] Total time: < 1 second
> [INFO] Finished at: Wed Aug 29 21:55:23 NZST 2007
> [INFO] Final Memory: 1M/4M
> [INFO]
> ----------------------------------------------------------------------
> --
> java.lang.NullPointerException
> at org.apache.maven.DefaultMaven.logReactorSummary
> (DefaultMaven.java:611)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:130)
> at org.apache.maven.embedder.MavenEmbedder.execute
> (MavenEmbedder.java:531)
> at org.maven.ide.eclipse.embedder.Maven2Executor.main
> (Maven2Executor.java:82)
>
>
> thoughts?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Joshua ChaitinPollak
Software Engineer
Kiva Systems
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org