Skip to content

Commit 5bb37c7

Browse files
authored
Merge pull request scalacenter#1948 from scalacenter/byeMaven
refactor: move the Maven plugin out of Bloop
2 parents f736b2a + b9f6da5 commit 5bb37c7

File tree

30 files changed

+31
-1932
lines changed

30 files changed

+31
-1932
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
- name: Tests
3838
run: |
3939
./bin/sbt-ci.sh \
40-
"mavenBloop/publishM2" \
41-
"mavenBloop/test" \
4240
"gradleBloop211/compile" \
4341
"gradleBloop212/compile" \
4442
"gradleBloop212/test" \

build.sbt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,6 @@ def isJdiJar(file: File): Boolean = {
476476
if (!System.getProperty("java.specification.version").startsWith("1.")) false
477477
else file.getAbsolutePath.contains(SbtJdiTools.JavaTools.getAbsolutePath.toString)
478478
}
479-
val publishJsonModuleSettings = List(
480-
publishM2Configuration := publishM2Configuration.value.withOverwrite(true),
481-
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
482-
// We compile in both so that the maven integration can be tested locally
483-
publishLocal := publishLocal.dependsOn(publishM2).value
484-
)
485479

486480
lazy val integrationUtils211 = project
487481
.in(integrations / "utils")
@@ -515,7 +509,6 @@ lazy val integrationUtils213 = project
515509
"integrations"
516510
) / "utils" / "target" / "utils-2.13").getAbsoluteFile
517511
)
518-
.settings(publishJsonModuleSettings)
519512

520513
lazy val sbtBloop10: Project = project
521514
.enablePlugins(ScriptedPlugin)
@@ -527,22 +520,6 @@ lazy val sbtBloop10: Project = project
527520
libraryDependencies += Dependencies.bloopConfig
528521
)
529522

530-
lazy val mavenBloop = project
531-
.in(integrations / "maven-bloop")
532-
.disablePlugins(ScriptedPlugin, ScalafixPlugin)
533-
.enablePlugins(BuildInfoPlugin)
534-
.settings(
535-
name := "maven-bloop",
536-
scalaVersion := Dependencies.Scala213Version,
537-
publishM2 := publishM2.dependsOn(integrationUtils213 / publishM2).value,
538-
BuildDefaults.mavenPluginBuildSettings,
539-
buildInfoKeys := Seq[BuildInfoKey](version),
540-
buildInfoPackage := "bloop",
541-
libraryDependencies += Dependencies.bloopConfig,
542-
testSettings
543-
)
544-
.dependsOn(integrationUtils213 % "test->compile")
545-
546523
lazy val gradleBloop211 = project
547524
.in(file("integrations") / "gradle-bloop")
548525
.enablePlugins(BuildInfoPlugin)
@@ -719,7 +696,6 @@ val allProjects = Seq(
719696
frontend,
720697
benchmarks,
721698
sbtBloop10,
722-
mavenBloop,
723699
gradleBloop211,
724700
gradleBloop212,
725701
gradleBloop213,
@@ -742,7 +718,6 @@ val allProjectsToRelease = Seq[ProjectReference](
742718
backend,
743719
frontend,
744720
sbtBloop10,
745-
mavenBloop,
746721
gradleBloop211,
747722
gradleBloop212,
748723
gradleBloop213,

docs-gen/src/main/scala/bloop/Docs.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ object Docs {
1515
.withSiteVariables(
1616
Map(
1717
"VERSION" -> Sonatype.releaseBloop.version,
18-
"LATEST_VERSION" -> bloop.internal.build.BuildInfo.version
18+
"LATEST_VERSION" -> bloop.internal.build.BuildInfo.version,
19+
"BLOOP_MAVEN_VERSION" -> Sonatype.releaseBloopMaven.version
1920
)
2021
)
2122
.withArgs(args.toList)

docs-gen/src/main/scala/bloop/docs/Sonatype.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ case class Release(version: String, lastModified: Date) {
2222
object Sonatype {
2323
import bloop.engine.ExecutionContext.ioScheduler
2424
lazy val releaseBloop = fetchLatest("bloop-frontend_2.12")
25+
lazy val releaseBloopMaven = fetchLatest("bloop-maven-plugin")
2526
lazy val releaseLauncher = fetchLatest("bloop-launcher_2.12")
2627

2728
/** Returns the latest published snapshot release, or the current release if. */

docs/build-tools/maven.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ sidebar_label: Maven
66

77
## Getting Started
88

9-
Configuring bloop with Maven projects speeds up developer workflows and gives you access to a modern Scala toolchain, despite Maven traditionally lacking good Scala suppport.
9+
Configuring Bloop with Maven projects speeds up developer workflows and gives
10+
you access to a modern Scala toolchain, despite Maven traditionally lacking good
11+
Scala support.
12+
13+
However, the Maven integration has a few issues that are not actively being
14+
worked on. If you're a Maven user, please help out and introduce yourself in our
15+
[Bloop Discord channel](https://discord.gg/KWF9zMhJWS) or comment on one of the
16+
[open issues](https://github.com/scalacenter/bloop-maven-plugin/issues) in its
17+
own repo at
18+
[`scalacenter/bloop-maven-plugin`](https://github.com/scalacenter/bloop-maven-plugin).
1019

11-
However, the Maven integration has a few issues that are not being actively
12-
worked on. If you're a Maven user, please help out and introduce yourself in
13-
our [Discord channel](https://discord.gg/KWF9zMhJWS) or comment on one
14-
of the [open Maven
15-
tickets](https://github.com/scalacenter/bloop/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Amaven).
1620

1721
<!-- start -->
1822

@@ -27,32 +31,24 @@ The Bloop plugin for Maven doesn't need to be installed, you can run
2731
following command.
2832

2933
```bash
30-
$ mvn ch.epfl.scala:maven-bloop_2.13:@VERSION@:bloopInstall
34+
$ mvn ch.epfl.scala:bloop-maven-plugin:@BLOOP_MAVEN_VERSION@:bloopInstall
3135
```
3236

3337
In some cases, when you are using generated sources in you project
3438
you might need to run:
3539

3640
```bash
37-
$ mvn generate-sources ch.epfl.scala:maven-bloop_2.13:@VERSION@:bloopInstall
38-
```
39-
40-
Note that the following command uses the latest Bloop stable version
41-
@VERSION@.
42-
43-
Here is the list of the latest Bloop stable and development versions. If you
44-
want to be on the very latest at the cost of misbehaviors, replace the above
45-
question with the development version.
46-
47-
```scala mdoc:releases
48-
I am going to be replaced by the docs infrastructure.
41+
$ mvn generate-sources ch.epfl.scala:bloop-maven-plugin:@BLOOP_MAVEN_VERSION@:bloopInstall
4942
```
5043

44+
**Note**: if you've used this command before you'll have noticed the artifact
45+
name has changed. In the past you would have used `maven-bloop_2.13`, however as
46+
of the 2.x series the artifact name has changed to `bloop-maven-plugin`.
5147

5248
To build with a single Scala project `foo` generates two configuration files:
5349

5450
```bash
55-
$ mvn ch.epfl.scala:maven-bloop_2.10:@VERSION@:bloopInstall
51+
$ mvn ch.epfl.scala:bloop-maven-plugin:@BLOOP_MAVEN_VERSION@:bloopInstall
5652
(...)
5753
Generated '/disk/foo/.bloop/foo.json'.
5854
Generated '/disk/foo/.bloop/foo-test.json'.
@@ -62,8 +58,8 @@ where:
6258
1. `foo` defines the main project; and,
6359
1. `foo-test` defines the test project and depends on `foo`
6460

65-
`maven-bloop` generates two configuration files per Maven project. One
66-
project for the main sources and another one for the tests. Bloop will skip
61+
The `bloop-maven-plugin` generates two configuration files per Maven project.
62+
One project for the main sources and another one for the tests. Bloop will skip
6763
config file generation for those projects that are not either Java or Scala.
6864

6965
## Verify installation and export
@@ -116,6 +112,6 @@ channel](https://discord.gg/KWF9zMhJWS).
116112

117113
### Detecting Java projects
118114

119-
At the moment, Java projects are not being detected. Head to [this
120-
ticket](https://github.com/scalacenter/bloop/issues/519) for a reproducible
121-
example.
115+
At the moment, Java projects are only partially supported in the Maven export.
116+
If you experience issues with this please open an
117+
[issue](https://github.com/scalacenter/bloop-maven-plugin).

docs/contributing-guide.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,25 @@ Before getting started you'll want to make sure you're in the right place. Some
1717
tools like [Mill](https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html)
1818
have their Bloop integration built-in, whereas others like
1919
[sbt](https://www.scala-sbt.org/) are in here. If you're working on an
20-
integration, make sure it's in this repo
20+
integration, make sure it's in this repo.
2121

2222
If you're making changes to the actual config structure, you'll want to make
2323
those changes in the
2424
[scalacenter/bloop-config](https://github.com/scalacenter/bloop-config) repo,
2525
which will then need to be released and included in this build.
2626

27+
If you're looking for the Maven integration, then you'll want to make those
28+
changes in
29+
[scalacenter/bloop-maven-plugin](https://github.com/scalacenter/bloop-maven-plugin).
30+
2731
## Project structure
2832

2933
Here's a list of the most important directories in the bloop repositories.
3034

3135
1. `backend` defines low-level compiler APIs wrapping Zinc APIs.
3236
1. `frontend` defines the core of bloop, the task scheduling, the CLI and all the supported tasks: compilation, testing, running and linking.
33-
1. `integrations` contains plugins for every supported build tool (such as sbt, Maven and Gradle) to extract any build to bloop.
37+
1. `integrations` contains plugins for some of the supported build tools, sbt
38+
and Gradle, to extract any build to bloop.
3439

3540
When contributing to bloop, you will most likely need to modify code in the
3641
above directories. The next directories define the rest of the project and

integrations/maven-bloop/src/main/java/bloop/integrations/maven/BloopMojo.java

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)