Open laeubi opened 9 months ago
Even if I use this with Tycho maven complains:
[WARNING] The POM for org.eclipse.platform:org.eclipse.swt:jar:3.124.200 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Doesn't specifying -Dosgi.platform=...
would work?
Note that this pom is generated from the p2 metadata...
It would work of course but that's really annoying to do on every build that wants to use SWT especially as the values are not obvious to the usual user, Tycho only specify by default these properties: https://tycho.eclipseprojects.io/doc/latest/TychoProperties.html
Doesn't specifying
-Dosgi.platform=...
would work?
I tried that but maven complains:
'dependencies.dependency.artifactId' for org.eclipse.platform:org.eclipse.swt.${osgi.platform}:jar with value 'org.eclipse.swt.${osgi.platform}' does not match a valid id pattern.
So it seems property expansion does not work in a consumed pom.
This works:
but this fails:
This seems to suggest that expansion is being done as expected...
Looking more generally in my .m2 folder, POMs like this one would not work at all without some kind of substitution kicking in:
It seems to me that the pom I see is often the one they are actually using to do a build...
The difference is that the swt.pom does not define the property at all....
That is a difference. Why does dependency:get work without a property definition? Because that's not a "consumed pom"?
For me the definition of the property works fine (I have it in aggregatordir/.mvn/maven.config, which is automatically picked up by maven). I still believe that those poms are invalid. It's okay to have variables in the local poms, but during deployment to Maven Central those must all be resolved AFAIK.
Have you ever looked at what people publish/dump to Maven central? It appears to me like it's "anything goes".
If one looks here:
https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.swt/3.124.200/org.eclipse.swt-3.124.200.pom
the pom list a dependency to
while this can work if some plugin defines
osgi.platform
it does not work in a plain maven build.One way would be to define all platforms inside a profile that is activated on the OS as seen here: https://github.com/jzy3d/jzy3d-api/blob/9e0f93aa958472e355b731c6ef7428088eb9c7a4/jzy3d-native-jogl-swt/pom.xml#L49-L115