random-maven / scalor-maven-plugin

Build integrator for Java, Scala, Scala.macro, Scala.js, Scala.native, Eclipse and Maven.
https://random-maven.github.io/scalor-maven-plugin/2.12/plugin-info.html
Other
50 stars 6 forks source link

test-cross sample project setup #4

Closed jimm-porch closed 6 years ago

jimm-porch commented 6 years ago

Thanks for making this plugin, I'm very interested in using it to publish artifacts across 2.11 and 2.12 for some of our existing Maven projects. Most of our team is familiar with Maven and we were trying to avoid having to use SBT for cross-builds if possible. We are looking for a plugin that can create cross-build artifacts on the commandline, and don't care about integration with any particular IDE.

I downloaded the source and tried compiling the test-cross project, but it doesn't build with the usual mvn clean install commandline.

What commandline should we use to build the test-cross project?

Here's an example with Maven 3.5.2 on my Mac. I have replaced the true host/port of our internal Maven repository to the fake hostname repo.mycompany.com

~/src/scalor-maven-plugin/src/it/test-cross$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T00:58:13-07:00)
Maven home: /Users/jimmccabe/bin/apache-maven-3.5.2
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

~/src/scalor-maven-plugin/src/it/test-cross$ mvn clean install
Downloading from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/com/carrotgarden/maven/arkon-maven-extension/maven-metadata.xml
Downloaded from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/com/carrotgarden/maven/arkon-maven-extension/maven-metadata.xml (389 B at 1.1 kB/s)
Downloading from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/com/carrotgarden/maven/profile-activator-extension/maven-metadata.xml
Downloaded from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/com/carrotgarden/maven/profile-activator-extension/maven-metadata.xml (439 B at 2.6 kB/s)
[INFO] Arkon: provisioning...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] scalor-maven-plugin-test-cross
[INFO] scalor-maven-plugin-test-cross_2.11
[INFO] scalor-maven-plugin-test-cross_2.12
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building scalor-maven-plugin-test-cross 0.0.0.20180125155158
[INFO] ------------------------------------------------------------------------
Downloading from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/@project/groupId@/@project.artifactId@/@project.version@/@project.artifactId@-@project.version@.pom
[WARNING] The POM for @project.groupId@:@project.artifactId@:jar:@project.version@ is missing, no dependency information available
Downloading from repo-nexus: http://repo.mycompany.com/nexus/content/groups/public/@project/groupId@/@project.artifactId@/@project.version@/@project.artifactId@-@project.version@.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] scalor-maven-plugin-test-cross ..................... FAILURE [  0.280 s]
[INFO] scalor-maven-plugin-test-cross_2.11 ................ SKIPPED
[INFO] scalor-maven-plugin-test-cross_2.12 ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.063 s
[INFO] Finished at: 2018-01-25T07:51:59-08:00
[INFO] Final Memory: 10M/204M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin @project.groupId@:@project.artifactId@:@project.version@ or one of its dependencies could not be resolved: Could not find artifact @project.groupId@:@project.artifactId@:jar:@project.version@ in repo-nexus (http://repo.mycompany.com/nexus/content/groups/public) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Andrei-Pozolotin commented 6 years ago

1) test-cross project runs under maven-invoker-plugin https://maven.apache.org/plugins/maven-invoker-plugin/

2) when test variables are substituted by the invoker: https://github.com/random-maven/scalor-maven-plugin/blob/master/src/it/test-cross/pom.xml#L98

            <plugin>
                <groupId>@project.groupId@</groupId>
                <artifactId>@project.artifactId@</artifactId>
                <version>@project.version@</version>
            </plugin>

3) so, please replace variables in your test project with release information http://search.maven.org/#search%7Cga%7C1%7Cscalor-maven-plugin_2.12

Andrei-Pozolotin commented 6 years ago

assume resolved