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

Support mill init from an existing Maven project (1500USD Bounty) #3449

Open
lihaoyi opened this issue Sep 3, 2024 · 10 comments
Open

Support mill init from an existing Maven project (1500USD Bounty) #3449

lihaoyi opened this issue Sep 3, 2024 · 10 comments
Labels

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Sep 3, 2024


From the maintainer Li Haoyi: I'm putting a 1500USD bounty on this issue, payable by bank transfer on a merged PR implementing this.


We should be able to run ./mill init to do a best effort conversion of an existing Maven project to Mill:

  • Code-generate a build.mill containing a MavenModulefor the root pom.xml, the package.mill for any subfolder pom.xmls
  • Convert the main and test dependencies on third-party libraries to ivyDeps
  • Convert inter-subproject dependencies to moduleDeps
  • Set any necessary javacOptions
  • Implement PublishModule with relevant metadata
  • Support POM inheritance, dependency management, etc.

Such a conversion will never be 100%, but if we can automate 80% of the conversion that will already be a huge help for people migrating to Mill or even just trying it out

Some prior art that can be used as reference:

@lihaoyi lihaoyi changed the title Support mill init from a Maven project Support mill init from a Maven project (1500USD Bounty) Sep 3, 2024
@lihaoyi lihaoyi changed the title Support mill init from a Maven project (1500USD Bounty) Support mill init from a SBT project (1500USD Bounty) Sep 3, 2024
@lihaoyi lihaoyi changed the title Support mill init from a SBT project (1500USD Bounty) Support mill init from a Maven project (1500USD Bounty) Sep 3, 2024
@lihaoyi lihaoyi changed the title Support mill init from a Maven project (1500USD Bounty) Support mill init from an existing Maven project (1500USD Bounty) Sep 3, 2024
@lefou lefou added the bounty label Sep 3, 2024
@arturaz
Copy link
Contributor

arturaz commented Sep 9, 2024

Is there any infrastructure for this already? For example, does mill init entry point exists?

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 9, 2024

@arturaz mill init already exists, and uses giter8 to initialize a repo based on some github URL:

def init(evaluator: Evaluator, args: String*): Command[Unit] = Target.command {

It should be pretty easy to add logic to check if there's an existing pom.xml in the project root and initialize based on that instead

@arturaz
Copy link
Contributor

arturaz commented Sep 9, 2024

I'll try to implement this :)

@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 9, 2024

@arturaz go for it!

@llvee
Copy link

llvee commented Sep 23, 2024

@arturaz Is this completed? If not do you mind if I give this a try 24 hours from now?

@arturaz
Copy link
Contributor

arturaz commented Sep 23, 2024 via email

@llvee
Copy link

llvee commented Sep 23, 2024

@arturaz Would you like some help with completing it?

@arturaz
Copy link
Contributor

arturaz commented Sep 23, 2024

@arturaz Would you like some help with completing it?

I'm not sure how that'd work, at least right now, but I will keep that in mind!

@llvee
Copy link

llvee commented Sep 25, 2024

@arturaz Bounty percentages seem like a reasonable option if you're interested in receiving help & sharing some bounty percentage.

@arturaz
Copy link
Contributor

arturaz commented Sep 25, 2024

Hey @llvee.

I think you should take over this. I've pushed what I've done to arturaz@3bcf834 , feel free to use any or none of it.

I've hit a bump while implementing BOM file support and thinking on how to translate that to mill when Maven allows property references to be used in any part of the artifact.

And then life hit me and now it seems I won't have time for at least 3 weeks.

I've used these repos as the target for conversion:

Cheers!

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

No branches or pull requests

4 participants