java - Variables in POM dependencies. How maven knows artifact id of SWT? -
the dependencies of piccolo2d-swt
described here as
group: ${swt.groupid} artifact: ${swt.artifactid} version: [3.3.0-v3346,)
how can resolved? take values of variables?
if run empty project dependency, displays error message, mentions org.eclipse.swt.win32
.
where did took value?
if printout value of these variables, nothing.
the pom here
<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_displaymavenvariables</groupid> <artifactid>test_displaymavenvariables</artifactid> <version>0.0.1-snapshot</version> <properties> <testproperty>this test property</testproperty> </properties> <!-- <dependencies> <dependency> <groupid>org.piccolo2d</groupid> <artifactid>piccolo2d-swt</artifactid> <version>1.3.1</version> </dependency> </dependencies> --> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <version>1.1</version> <executions> <execution> <phase>validate</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <echo>displaying value of properties</echo> <echo>[testproperty] ${testproperty}</echo> <echo>[swt.artifactid] ${swt.artifactid}</echo> <echo>[swt.groupid] ${swt.groupid}</echo> </tasks> </configuration> </execution> </executions> </plugin> </plugins> <pluginmanagement> <plugins> <!--this plugin's configuration used store eclipse m2e settings only. has no influence on maven build itself.--> <plugin> <groupid>org.eclipse.m2e</groupid> <artifactid>lifecycle-mapping</artifactid> <version>1.0.0</version> <configuration> <lifecyclemappingmetadata> <pluginexecutions> <pluginexecution> <pluginexecutionfilter> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <versionrange>[1.1,)</versionrange> <goals> <goal>run</goal> </goals> </pluginexecutionfilter> <action> <ignore></ignore> </action> </pluginexecution> </pluginexecutions> </lifecyclemappingmetadata> </configuration> </plugin> </plugins> </pluginmanagement> </build> </project>
the swt.groupid
, swt.artifactid
variables being defined via maven profiles in piccolo2d-swt pom file, example:
<profile> <id>windows_x86</id> <activation> <os> <family>windows</family> <arch>x86</arch> </os> </activation> <properties> <swt.groupid>org.eclipse.swt.win32.win32</swt.groupid> <swt.artifactid>x86</swt.artifactid> </properties> </profile>
a profile being defined each platform , profile activated based on os.family
, os.arch
detected when run maven.
Comments
Post a Comment