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

Project crystal #882

Open
khalilou88 opened this issue Feb 15, 2024 · 6 comments
Open

Project crystal #882

khalilou88 opened this issue Feb 15, 2024 · 6 comments

Comments

@khalilou88
Copy link
Owner

khalilou88 commented Feb 15, 2024

I think of adding targets to plugin option so if build and test not present in the project.json or the project.json is not present. This will be added automatically:

{
  "targets": [
    {
      "defaultName": "build",
      "customName": "build-maven",
      "defaultTask": "install"
    },
    {
      "defaultName": "test",
      "customName": "test-maven",
      "defaultTask": "test"
    },
    {
      "defaultName": "ktlint",
      "defaultTask": "antrun:run@ktlint"
    }
  ]
}

the customName will be optional.

we should use task from Nx default targets first and if not present we use defaultTask from plugin options.

@jbadeau
Copy link

jbadeau commented Mar 25, 2024

Im curious how crystal can help with the maven integration. On another note, we could contribute migrators as we currently maintain them ourselves but would be good to put them where they belong?

@khalilou88
Copy link
Owner Author

New design:

{
  "mavenRootDirectory": "nx-maven",
  "localRepoRelativePath: ".m2/repository",
  "buildTargetName": "build-maven",
  "testTargetName": "test-maven",
  "targets": [
    {
      "target": "build-maven",
      "defaultTask": "install"
    },
    {
      "target": "test-maven",
      "defaultTask": "test"
    },
    {
      "target": "ktlint",
      "defaultTask": "antrun:run@ktlint"
    }
  ]
}

@jbadeau
Copy link

jbadeau commented Apr 25, 2024

I like the *TargetName options.

would make targets optional and change defaultTask to task

@khalilou88
Copy link
Owner Author

I already added buildTargetName to the plugin options: 628c80f

@khalilou88
Copy link
Owner Author

khalilou88 commented Apr 25, 2024

I believe we need more than one task:

    {
      "target": "build-maven",
      "appTask": "compile -DskipTests=true",
      "libTask": "install -DskipTests=true",
      "defaultTask": "install"
    },

@jbadeau
Copy link

jbadeau commented Apr 26, 2024

{
  "mavenRootDirectory": ".",
  "localRepoRelativePath: ".m2/repository",
  "lintTargetName": "maven-lint",
  "formatTargetName": "maven-format",
  "testTargetName": "maven-test",
  "buildTargetName": "maven-build",
  "releaseTargetName": "maven-release",
  "e2eTargetName": "maven-e2e"
  "targets": [
    {
      "target": "testTargetName",
      "task": "test"
    },
    {
      "target": "buildTargetName",
      "task": "clean install -DskipTests=true"
    },
    {
      "target": "releaseTargetName",
      "task": "deploy -DskipTests=true"
    }
    ...
  ]
}

An issue here is that there is allot of rebuilding going on. Would be nice to have something like

  • call mvn surefire:test for tests
  • release with {packaging}:{packaging} deploy:deploy to not rebuild again. Would need to check the pom.xml for the packaging type in the plugin
  • call mvn failsafe:integration-test for e2e

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

2 participants