cowwoc wrote:
> 
> 
> Jörg Schaible-3 wrote:
>> 
>> The point is that it is platform dependent - the platform your developer
>> is 
>> using. A profile should not be used to define dependencies - at least if 
>> those should be transitively inherited. It simply does not work in the
>> way 
>> most people assume. It is not inherited anyway, therefore you have to
>> define 
>> it already twice (in A and B). This does not scale also.
>> 
>> What you might try is to define a swt pom (or package type pom) for all 
>> platforms like:
>> 
>> ...
>>   <groupId>com.eclipse</groupId>
>>   <artifactId>swt-generic</artifactId>
>>   <version>3.6.1</version>
>>   <packaging>pom</packaging>
>> 
>>   <profiles>
>>     <profile>
>>       <id>win32</id>
>>       <dependencies>
>>         <groupId>com.eclipse</groupId>
>>         <artifactId>swt</artifactId>
>>         <version>3.6.1</version>
>>         <classifier>win32-x86</classifier>
>>       </dependencies>
>>     </profile>
>>     ...
>>   </profiles>
>> 
>> and refer that everywhere you need it as provided:
>> 
>> ..
>>     <dependency>
>>       <groupId>com.eclipse</groupId>
>>       <artifactId>swt-generic</artifactId>
>>       <version>3.6.1</version>
>>       <type>pom</type>
>>       <scope>provided</scope>
>>     </dependency>
>> ..
>> 
>> Your developers may actually set their default in the settings.xml:
>> 
>>   <activeProfiles>
>>     <activeProfile>win32</activeProfile>
>>     ...
>>   </activeProfiles>
>>   <profiles>
>>     <profile>
>>       <id>win32</id>
>>     </profile>
>>     ...
>>   </profiles>
>> 
>> The provided scope prevents that a special one is taken and you have to 
>> select the appropriate one(s) when packaging your app e.g. with the
>> assembly 
>> plugin.
>> 
> 
> Hi Jörg,
> 
> I followed your instructions but I don't understand how:
> 
>   <activeProfiles>
>     <activeProfile>win32</activeProfile>
>     ...
>   </activeProfiles>
>   <profiles>
>     <profile>
>       <id>win32</id>
>     </profile>
>     ...
>   </profiles>
> 
> leads to the inclusion of the Windows-specific SWT library. It doesn't
> seem to activate the "win32" profile in the SWT project. Any ideas?
> 
> Gili
> 

I should clarify: I can see how <activeProfile> causes the SWT project to
build correctly (generating a Windows JAR file). What I can't see is how to
get that JAR file to show up as a dependency in the project that depends on
SWT.

One final complication: is there a way for me to define ${swt.classifier} in
the SWT project and have it  show in the child project? My first use-case is
to include SWT as a normal dependency. My second use-case is to use
maven-unpack-plugin to download and unpack the JAR file. To do the latter, I
need the classifier name in the child project.

Thanks,
Gili
-- 
View this message in context: 
http://maven.40175.n5.nabble.com/POM-inheritance-breaks-build-tp3263869p3309568.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to