Giter Site home page Giter Site logo

Comments (6)

zen0wu avatar zen0wu commented on June 22, 2024

Hi @dunnololda Sorry for the inconvenient. The plugin is still young, and may have some bugs.

About your situation, you can type show library-dependencies on sbt console to see if the correct
dependencies are imported. If not, maybe there're some bugs in the plugin, and please tell me which artifact is wrong if allowed.

Thanks.

from sbt-maven-plugin.

delorum avatar delorum commented on June 22, 2024

Hi shivawu!
Ok, here is one of my maven projects I test your plugin on:
https://github.com/dunnololda/scala-cli
You can clone it and do the same things.
Here is what I doing:
In scala-cli folder I create the folder project:
$ mkdir project
$ cd project

Then I create plugins.sbt file in it and add the plugin definition to this file:
$ cat project/plugins.sbt
addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.0")

Then here is the sbt output:
$ sbt
[info] Loading project definition from /home/andrey/java/workspace-scala/scala-cli/project
[info] Loading [pom.xml]
[success] POM definition loaded
[info] Set current project to default-36153a (in build file:/home/andrey/java/workspace-scala/scala-cli/)

show library-dependencies
[info] List(org.scala-lang:scala-library:2.9.2)
compile
[info] Compiling 5 Scala sources to /home/andrey/java/workspace-scala/scala-cli/target/scala-2.9.2/classes...
[error] /home/andrey/java/workspace-scala/scala-cli/src/main/scala/com/github/dunnololda/cli/MySimpleLogger.scala:3: object slf4j is not a member of package org
[error] import org.slf4j.LoggerFactory
[error] ^
[error] one error found
error Compilation failed
[error] Total time: 4 s, completed 10.04.2013 13:11:41

So where are all the dependencies?) Sbt version: 0.12.3

from sbt-maven-plugin.

zen0wu avatar zen0wu commented on June 22, 2024

I've fixed the bug(it's very stupid, shame on me) and released another version.

However, there're some other problems in your project, like your artifact id has properties in it, which is not considered yet by this plugin right now.

I'll fix this maybe tomorrow, there're still some testing work to do.

from sbt-maven-plugin.

delorum avatar delorum commented on June 22, 2024

However, there're some other problems in your project, like your artifact id has properties in it, which is not considered yet by this plugin right now.

In my another project where artifactId has no properties included, version 0.1.1 works fine (compilation works). Although, "show library-dependencies" shows only scala:

show library-dependencies
[info] List(org.scala-lang:scala-library:2.9.2)

Is it correct? In my dependencies list I also have casbah, akka and serveral other libraries.

In scala-cli sbt fails to start:
$ sbt
[info] Loading project definition from /home/andrey/java/workspace-scala/scala-cli/project
[info] Loading [pom.xml]
[info] Use pom.xml automatically
[info] Loading maven settings from /home/andrey/.m2/settings.xml
[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

Is it because of artifactId with properties? If you can fix it pls do, as this way to compile scala libraries for many scala versions is very convenient (and compatible with sbt's %%).

from sbt-maven-plugin.

zen0wu avatar zen0wu commented on June 22, 2024
  1. I tried some of your projects and they all worked ok(except for one, which maven doesn't succeed to compile), and show library-dependencies on each project works ok. If it only shows scala-library, there're definitely some problems, but I didn't manage to reproduce it, maybe cause I'm using my current snapshot version.
  2. About the properties in artifact, if you type l when the error occurs, you can see that's the reason. And yes, it can be fixed, but now I only come up with a workaround, with the limitation of that it can only resolve properties WITHOUT inheritance. If you define your property in the parent pom, it will not be resolved.
    Maven will give a warning about property in artifact id, so it's not supposed to use that way. And, with this plugin, you don't need the scala version in the artifact id, you can just set crossScalaVersions in build.sbt, and sbt will do that for you, I think that's the correct way to archive this.
  3. You can try my snapshot version(0.1.2-SNAPSHOT) by now(add sonatype snapshot repository to your pom.xml), the relase version will be released in 1-2 days.

from sbt-maven-plugin.

zen0wu avatar zen0wu commented on June 22, 2024

@dunnololda I've released a 0.1.2, try it out!

from sbt-maven-plugin.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.