Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.10.1 & 4.10.2: Cannot publish artifact 'compileScala.mapping' (PATH) as it does not exist. #6849

Closed
drujd opened this issue Sep 21, 2018 · 12 comments

Comments

@drujd
Copy link

drujd commented Sep 21, 2018

project(':scala-for-tests-only') {
    apply plugin: 'java-library'
    apply plugin: 'scala'
    apply plugin: 'maven'

    repositories {
        mavenCentral()
    }

    //scala joint compilation for tests
    sourceSets.test.java.srcDirs.each { sourceSets.test.scala.srcDir it }
    sourceSets.test.java.srcDirs = []

    dependencies {
        compile 'org.scala-lang:scala-library:2.12.6'
    }
}

This project (which contains only Java main classes, but utilises Scala for joint compilation of Java and Scala test classes) fails on :scala-for-tests-only:install with

Execution failed for task ':test-classes-only:install'.
> Could not publish configuration 'archives'
   > Cannot publish artifact 'compileScala.mapping' (PATH\test-classes-only\build\tmp\scala\compilerAnalysis\compileScala.mapping) as it does not exist.

This happens only on 4.10.1 and 4.10.2. 4.10 and older versions work.

@big-guy
Copy link
Member

big-guy commented Sep 21, 2018

Yep, I've confirmed this.

As a workaround, you can create a src/main/scala/ScalaForTestsWorkaround.scala with something like class ScalaForTestsWorkaround in it.

Is test-classes-only used for sharing test fixtures/base classes with other projects or does it build other things in src/main?

@drujd
Copy link
Author

drujd commented Sep 21, 2018

The problem occurs in both cases. If there are some non-test java (but not scala) classes, the easy fix is to also add

sourceSets.main.java.srcDirs.each { sourceSets.main.scala.srcDir it }
sourceSets.main.java.srcDirs = []

so the joint compiler is used for the java classes. If there are only test classes in the project, then you have to use the ugly workaround. :/

@big-guy
Copy link
Member

big-guy commented Sep 21, 2018

If there are only test classes, you could also put everything in "main" if you are sharing those classes with other projects. This is what we do in gradle/gradle for our testing only infrastructure projects.

@brosander
Copy link

Seeing this as well in modules that have all java source + scalatests

@drujd
Copy link
Author

drujd commented Sep 24, 2018

@brosander That can be fixed by

sourceSets.main.java.srcDirs.each { sourceSets.main.scala.srcDir it }
sourceSets.main.java.srcDirs = []

@ymwang1984
Copy link
Contributor

ymwang1984 commented Sep 24, 2018

Seeing this as well in some of our production Scala projects at LinkedIn

@drujd
Copy link
Author

drujd commented Sep 27, 2018

@big-guy Moving tests to main is a pretty ugly workaround.

@zatekusen
Copy link

We seeing this error appeared randomly even in normal module as well. Haven't investigated further but it does look like that it happens when we just rerun the same build and some tasks are cached.

@drujd
Copy link
Author

drujd commented Oct 2, 2018

Yup. With 4.10 this works well, but there are other bugs...

@big-guy
Copy link
Member

big-guy commented Dec 4, 2018

This will be released in 4.10.3 (hopefully today)

@big-guy big-guy closed this as completed Dec 4, 2018
@drujd
Copy link
Author

drujd commented Dec 4, 2018

Is the fix present also in 5.0?

@big-guy
Copy link
Member

big-guy commented Dec 4, 2018

Yes

hyochan pushed a commit to dooboolab-community/flutter_inapp_purchase that referenced this issue Mar 13, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [gradle](https://gradle.org)
([source](https://togithub.com/gradle/gradle)) | patch | `4.10.2` ->
`4.10.3` |

---

### Release Notes

<details>
<summary>gradle/gradle</summary>

###
[`v4.10.3`](https://togithub.com/gradle/gradle/releases/tag/v4.10.3):
4.10.3

This bug-fix release contains **3** changes to Gradle 4.10.2:

-
[gradle/gradle#7510
-
[gradle/gradle#6849
-
[gradle/gradle#7014

It also incorporates all fixes to 4.10.1 and 4.10.2.

We recommend that you use Gradle 4.10.3 over 4.10, 4.10.1 and 4.10.2.

#### Upgrade Instructions

Switch your build to use Gradle 4.10.3 by updating your wrapper
properties:

`./gradlew wrapper --gradle-version=4.10.3`

Standalone downloads are available at https://gradle.org/install.

#### Reporting Problems

If you find a problem with Gradle 4.10.3, please file a bug on [GitHub
Issues](https://togithub.com/gradle/gradle/issues) adhering to our issue
guidelines. If you're not sure you're encountering a bug, please use the
[forum](https://discuss.gradle.org/c/help-discuss).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/dooboolab/flutter_inapp_purchase).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants