Running mvn scala:run without compiling again
See original GitHub issueI’m running mvn scala:compile
and then mvn scala:run
.
But seems that mvn scala:run
is calling the compile and skipping it because files are already there.
Is there an option to run it wuthout checking?
$ mvn scala:run -DmainClass=example.Hello
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.example:sample-scala-hbase >-------------------
[INFO] Building Sample Scala HBase App 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> scala-maven-plugin:3.3.2:run (default-cli) > test-compile @ sample-scala-hbase >>>
Downloading from apache.snapshots: https://repository.apache.org/snapshots/net/minidev/json-smart/maven-metadata.xml
Downloading from apache.snapshots.https: https://repository.apache.org/content/repositories/snapshots/net/minidev/json-smart/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml
Downloading from dynamodb-local-oregon: https://s3-us-west-2.amazonaws.com/dynamodb-local/release/net/minidev/json-smart/maven-metadata.xml
Downloading from repository.jboss.org: https://repository.jboss.org/nexus/content/groups/public/net/minidev/json-smart/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml (1.2 kB at 934 B/s)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sample-scala-hbase ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sample-scala-hbase ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.3.2:compile (default) @ sample-scala-hbase ---
[WARNING] Expected all dependencies to require Scala version: 2.13.8
[WARNING] com.example:sample-scala-hbase:1.0.0 requires scala version: 2.13.8
[WARNING] org.scalameta:munit_2.13:0.7.29 requires scala version: 2.13.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sample-scala-hbase ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\projects\sample-scala-hbase\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sample-scala-hbase ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.3.2:testCompile (default) @ sample-scala-hbase ---
[WARNING] Expected all dependencies to require Scala version: 2.13.8
[WARNING] com.example:sample-scala-hbase:1.0.0 requires scala version: 2.13.8
[WARNING] org.scalameta:munit_2.13:0.7.29 requires scala version: 2.13.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< scala-maven-plugin:3.3.2:run (default-cli) < test-compile @ sample-scala-hbase <<<
[INFO]
[INFO]
[INFO] --- scala-maven-plugin:3.3.2:run (default-cli) @ sample-scala-hbase ---
[WARNING] Expected all dependencies to require Scala version: 2.13.8
[WARNING] com.example:sample-scala-hbase:1.0.0 requires scala version: 2.13.8
[WARNING] org.scalameta:munit_2.13:0.7.29 requires scala version: 2.13.6
[WARNING] Multiple versions of scala libraries detected!
hello
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.812 s
[INFO] Finished at: 2022-06-15T00:00:39+10:00
[INFO] ------------------------------------------------------------------------
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Maven skip compile - java - Stack Overflow
Set this to 'true' to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on occasion. User property is:...
Read more >Scala with Maven
Note: the plugin includes Scala from the Central Repository so there's no need to install it yourself if you're compiling with Maven.
Read more >scala-maven-plugin – Example
Running a "main(args: Array[String])". You must have a well define project, and it must compile your code successfully before (see Compiling ).
Read more >Run script in execution doesn't work · Issue #31 - GitHub
I start to rewrite the way classpath is define for running script, and it should allow running script like in the book (I...
Read more >Upgrade to Scala 2.11, mvn scala:cc error: "Could not connect ...
... (mvn scala:cc). (Normal compilation works fine, and switching back to 2.9 cc works again): ... [No compilation server running.] [INFO] start server....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, just use use maven-assembly-plugin then. It would work just fine.
Thanks again @slandelle, my goal was to use the
scala-maven-plugin
for CI/CD. Building and packaging in one machine, and then running it on the other machine, without trying to compile again. Is it possible to build a fat jar withscala-maven-plugin
? Similar to whatmaven-assembly-plugin
does?Maybe that is not the goal of the
scala-maven-plugin
. Thescala-maven-plugin
is just for local development?Sorry these basics questions, I’m new to scala.