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

No class files in io.mockk:mockk:1.12.6 or io.mockk:mockk:1.12.7. #891

Closed
bbain opened this issue Aug 23, 2022 · 8 comments
Closed

No class files in io.mockk:mockk:1.12.6 or io.mockk:mockk:1.12.7. #891

bbain opened this issue Aug 23, 2022 · 8 comments

Comments

@bbain
Copy link

bbain commented Aug 23, 2022

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

There are classes in the jar files.

Current Behavior

There are no classes in the jars. Not possible to compile against the library.

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 or 1.12.7
  • OS: MacOS
  • Kotlin version: 1.7.10
  • JDK version: 11
  • JUnit version: 5
  • Type of test: unit test
@alvindizon
Copy link

Did you also get this error? Could not find io.mockk:mockk-jvm:1.12.6? Our project also cannot use this update because of this error

@bbain
Copy link
Author

bbain commented Aug 24, 2022

I cold see the jar file though it may have been on our maven proxy. The actual problem is when trying to compile I get:

Unresolved reference: mockk
....

Because the jar itself is empty.

@stefanzilske
Copy link

Same here, already reported yesterday for 1.12.6 in #884. Seems not to be resolved with 1.12.7.

@aSemy
Copy link
Contributor

aSemy commented Aug 24, 2022

Are you using Maven? Might be the same issue as
#889 (comment)

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

NOTE this is a temp fix, and won't be necessary in an upcoming MockK release (#905)

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

@bbain
Copy link
Author

bbain commented Aug 24, 2022

So we are using maven. This fails:

<dependency>
    <groupId>io.mockk</groupId>
    <artifactId>mockk</artifactId>
    <version>1.12.7</version>
    <scope>test</scope>
</dependency>

Changing it to something like this works:

<dependency>
    <groupId>io.mockk</groupId>
    <artifactId>mockk-jvm</artifactId>
    <version>1.12.7</version>
    <exclusions>
        <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </exclusion>
    </exclusions>
    <scope>test</scope>
</dependency>

Are we meant to now depend on mockk-jvm directly?

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 24, 2022

Yes, if you use maven you need to depend on mockk-jvm rather than mockk because maven does not understand multiplatform projects.

I think this should be added to the docs, in fact.

@Raibaz Raibaz closed this as completed Aug 24, 2022
@aSemy
Copy link
Contributor

aSemy commented Aug 24, 2022

<dependency>
    <groupId>io.mockk</groupId>
    <artifactId>mockk-jvm</artifactId>
    <version>1.12.7</version>
    <exclusions>
        <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </exclusion>
    </exclusions>
    <scope>test</scope>
</dependency>

Hmm you shouldn't need to exclude JUnit. If it is necessary, then I think that's something that should be fixed, if possible.

@bbain
Copy link
Author

bbain commented Aug 24, 2022

Hmm you shouldn't need to exclude JUnit. If it is necessary, then I think that's something that should be fixed, if possible.

Sorry. My project has a check that JUnit 4 does not get included as a transitive dep. I'm sure it would work without this exclude.

abintrd added a commit to Tradeshift/blayze that referenced this issue May 30, 2023
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

5 participants