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

mockk-1.12.6.jar from MavenCentral is empty #884

Closed
3 tasks done
stefanzilske opened this issue Aug 23, 2022 · 20 comments
Closed
3 tasks done

mockk-1.12.6.jar from MavenCentral is empty #884

stefanzilske opened this issue Aug 23, 2022 · 20 comments

Comments

@stefanzilske
Copy link

Just be aware about usual MockK support pattern.
Tickets are checked from time to time, replied, discussed, labeled, e.t.c.
But real fixes are applied in a month-two month period in a bunch.
If you think this is unacceptable, go on, join the project, change the world.

Please remove sections wisely

Below information is actually needed to make all the process of fixing faster.
Choose main points. Don't blindly follow this as a set of rules.
Don't waste much time. Usually, the main thing is to have a good reproducible minimal code.

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

Upgrading to mock 1.12.6 should contain no breaking changes.

Current Behavior

The jar downloaded from Maven Central is empty, it contains only META-INF directory: https://search.maven.org/artifact/io.mockk/mockk/1.12.6/jar

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • MockK version: 1.12.6
  • OS: macOS 12.5.1
  • Kotlin version: 1.7.10
  • JDK version: 17.0.4
  • JUnit version: 5.8.2
  • Type of test: any test
@sschuberth
Copy link

Also e.g. https://repo.maven.apache.org/maven2/io/mockk/mockk-jvm/1.12.6/mockk-jvm-1.12.6.pom is missing completely.

@qoomon
Copy link
Contributor

qoomon commented Aug 23, 2022

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

Definitely something wrong with the new buildfiles introduced lately, my bad, going to fix this.

Sorry for the inconvenience.

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

So, apparently switching to the multiplatform build introduced the mockk-jvm module that is, in fact, new, as @qoomon noticed.

It's being published on sonatype, but then it does not go to maven central.

Looking into it, it should just be a matter of telling sonatype to publish all modules to maven central.

@aSemy
Copy link
Contributor

aSemy commented Aug 23, 2022

An other strange thing is that https://repo.maven.apache.org/maven2/io/mockk/mockk-jvm/1.12.6/ does exist, however https://repo.maven.apache.org/maven2/io/mockk/mockk-jvm/1.12.5/ does not

Previously the mockk-jvm project was named mockk

base {
archivesBaseName = "mockk"
}

Now the naming is handled by the Kotlin Multiplatform project, which publishes a common mockk library, and a JVM variant.

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

Yep I figured so, so now the io.mockk:mockk dependency is just a container that includes the JVM variant as a transitive dependency.

It shouldn't be an issue, if only mockk-jvm was published on maven central :)

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

Added a comment here https://issues.sonatype.org/browse/OSSRH-35388 to see if it's an issue with sonatype.

pjwalstrom added a commit to navikt/tiltakspenger-institusjon that referenced this issue Aug 23, 2022
@alexroussiereTT
Copy link

Idk if this is related, but was the mockk-android library supposed to get the 1.12.6 version as well? From https://search.maven.org/search?q=g:io.mockk it seemed that there are 4 artifacts that didn't get the update yet, but maybe it's because the release was not long ago?
Just an observation :)

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

Ok i got to publish 1.12.7 to maven central, which seemingly includes mockk-jvm as well.

I'd like some of you to at least give it a try before publishing a release on GitHub, can you please try upgrading to 1.12.7 and checking if everything is fine?

Tagging folks like @qoomon and @aSemy in case they can provide feedback

@alvr
Copy link

alvr commented Aug 23, 2022

1.12.7 is working fine for me @Raibaz, now artifact mockk-jvm is found. I don't know if mockk-android is also found because I don't use that artifact.

@goerge
Copy link

goerge commented Aug 23, 2022

@Raibaz LGTM, too!

@SimonMarquis
Copy link
Contributor

It looks good for the mockk-android artifact as well

io.mockk:mockk-android:1.12.7
├─ io.mockk:mockk-agent-android:1.12.7 (runtime)
│  ├─ com.linkedin.dexmaker:dexmaker:2.28.1 (runtime)
│  │  └─ com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3 (runtime)
│  │     └─ junit:junit:4.12 (test)
│  │        └─ org.hamcrest:hamcrest-core:1.3
│  ├─ io.mockk:mockk-agent-api:1.12.7 (compile)
│  │  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (runtime)
│  │     ├─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10 (compile)
│  │     │  └─ org.jetbrains.kotlin:kotlin-stdlib:1.7.10 (compile)
│  │     │     ├─ org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10 (compile)
│  │     │     └─ org.jetbrains:annotations:13.0 (compile)
│  │     └─ org.jetbrains.kotlin:kotlin-stdlib:1.7.10 (compile)️
│  ├─ io.mockk:mockk-agent:1.12.7 (compile)
│  │  ├─ io.mockk:mockk-agent-api:1.12.7 (runtime)
│  │  │  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (runtime)️
│  │  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (runtime)️
│  ├─ org.jetbrains.kotlin:kotlin-reflect:1.7.10 (runtime)
│  │  └─ org.jetbrains.kotlin:kotlin-stdlib:1.7.10 (compile)️
│  ├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (compile)
│  │  ├─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10 (compile)️
│  │  └─ org.jetbrains.kotlin:kotlin-stdlib:1.7.10 (compile)️
│  └─ org.objenesis:objenesis:3.2 (runtime)
│     └─ org.objenesis:objenesis-test: (test)
├─ io.mockk:mockk-agent-api:1.12.7 (runtime)️
├─ io.mockk:mockk:1.12.7 (runtime)
│  ├─ io.mockk:mockk-dsl:1.12.7 (runtime)
│  │  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (runtime)️
│  └─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (runtime)️
├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 (compile)️
└─ org.jetbrains.kotlinx:kotlinx-coroutines-core: (runtime)

@alexroussiereTT
Copy link

mockk-android is working for me as well 💯

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 23, 2022

Ok, I released 1.12.7, thanks a lot everyone for the feedback and the patience!

@Raibaz Raibaz closed this as completed Aug 23, 2022
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 23, 2022
This fixes a deployment issue [1] with version 1.12.6 [2].

[1]: mockk/mockk#884
[2]: https://github.com/mockk/mockk/releases/tag/1.12.6

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 23, 2022
This fixes a deployment issue [1] with version 1.12.6 [2].

[1]: mockk/mockk#884
[2]: https://github.com/mockk/mockk/releases/tag/1.12.6

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@stefanzilske
Copy link
Author

To me it's still not resolved. mockk-1.12.7.jar is still empty. Do I have to switch to mockk-jvm dependency instead?

cf. #891

@sschuberth
Copy link

To me it's still not resolved. mockk-1.12.7.jar is still empty. Do I have to switch to mockk-jvm dependency instead?

At least Gradle picks the JVM artifact automatically, and I also can confirm our project to build fine with MockK 1.12.7.

@aSemy
Copy link
Contributor

aSemy commented Aug 24, 2022

If you're using Maven, can you try changing mockk to mockk-jvm?

<dependency>
  <groupId>io.mockk</groupId>
  <!-- <artifactId>mockk</artifactId> -->
  <artifactId>mockk-jvm</artifactId>
  <version>${mockk.version}</version>
</dependency>

#889 (comment)

@stefanzilske
Copy link
Author

@aSemy yes code compiles again when I switch to mockk-jvm. However during test execution I am now getting the following exceptions:

java.lang.NoSuchMethodError: 'kotlin.reflect.KClass io.mockk.ValueClassSupportKt.boxedClass(kotlin.reflect.KClass)'

	at io.mockk.impl.instantiation.JvmMockFactoryHelper.toDescription$mockk(JvmMockFactoryHelper.kt:150)
	at io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invocation(JvmMockFactoryHelper.kt:25)
	at io.mockk.proxy.jvm.advice.Interceptor.call(Interceptor.kt:21)
	at io.mockk.proxy.jvm.advice.BaseAdvice.handle(BaseAdvice.kt:42)
	at io.mockk.proxy.jvm.advice.jvm.JvmMockKProxyInterceptor.interceptNoSuper(JvmMockKProxyInterceptor.java:45)
	at ...
	at ...
	at ...
	at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$1.invoke(RecordedBlockEvaluator.kt:25)
	at io.mockk.impl.eval.RecordedBlockEvaluator$enhanceWithRethrow$1.invoke(RecordedBlockEvaluator.kt:78)
	at io.mockk.impl.recording.JvmAutoHinter.autoHint(JvmAutoHinter.kt:23)
	at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:40)
	at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
	at io.mockk.MockKDsl.internalEvery(API.kt:93)
	at io.mockk.MockKKt.every(MockK.kt:98)

Is this a separate issue?

@Michael-Duivestein
Copy link

@stefanzilske I'm seeing something similar after trying to upgrade from mockk 1.12.4 to mockk-jvm 1.12.7.
Using Maven.

java.lang.NoSuchMethodError: 'void io.mockk.MethodDescription.<init>(java.lang.String, kotlin.reflect.KClass, boolean, boolean, boolean, kotlin.reflect.KClass, java.util.List, int, boolean)'

	at io.mockk.impl.instantiation.JvmMockFactoryHelper.toDescription$mockk(JvmMockFactoryHelper.kt:136)
	at io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invocation(JvmMockFactoryHelper.kt:27)
	at io.mockk.proxy.jvm.advice.Interceptor.call(Interceptor.kt:21)
	...
	at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$1.invoke(RecordedBlockEvaluator.kt:24)
	at io.mockk.impl.eval.RecordedBlockEvaluator$enhanceWithNPERethrow$1.invoke(RecordedBlockEvaluator.kt:74)
	at io.mockk.impl.recording.JvmAutoHinter.autoHint(JvmAutoHinter.kt:23)
	at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:36)
	at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
	at io.mockk.MockKDsl.internalEvery(API.kt:93)
	at io.mockk.MockKKt.every(MockK.kt:104)

@aSemy
Copy link
Contributor

aSemy commented Aug 24, 2022

Seeing ValueClassSupportKt in the error suggests to me it's this issue: #868 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants