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

passing maven flags, and postUnpack #36

Open
deliciouslytyped opened this issue Feb 12, 2020 · 4 comments
Open

passing maven flags, and postUnpack #36

deliciouslytyped opened this issue Feb 12, 2020 · 4 comments

Comments

@deliciouslytyped
Copy link

deliciouslytyped commented Feb 12, 2020

I'm not sure where else to ask this;
I'm trying to build https://github.com/sismics/docs and it says to pass -Pprod and run mvn -Pprod -DskipTests clean install from the docs-web directory, but setting

  postUnpack = ''
    cd source/docs-web
    sleep 1000;
    '';

in the default.nix generated by mavenix doesn't seem to do anything, and setting MAVEN_OPTS = "-Pprod"; causes:

 mvnix-update

  Getting mavenix meta data...

/nix/store/4rcdfir519a8pc8n26472ik35gl4lddn-mk-repo
/nix/store/9nchmr86bcqjmp0dilcp1lwp5yvcc64v-settings.xml
warning: you did not specify '--add-root'; the result might be removed by the garbage collector

  Running mvn package...

warning: ignoring the user-specified setting 'show-trace', because it is a restricted setting and you are not a trusted user
Unrecognized option: -Pprod
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

What's the correct way to do this? (I don't really know anything about maven) I imagine I'm passing -Pprod in the wrong place.

@deliciouslytyped
Copy link
Author

So, I think doing something like

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <activeProfiles>
      <activeProfile>prod</activeProfile>
    </activeProfiles>
    </settings>

solves the -Pprod problem.

@deliciouslytyped deliciouslytyped changed the title passing -Pprod and building from a specific directory passing maven flags, and postUnpack Feb 12, 2020
@deliciouslytyped
Copy link
Author

The postUnpack problem still remains, but in a different way now:
I need to deal with preparing some nodejs stuff in the build, and I'd want to put some code in postUnpack for that.

@deliciouslytyped
Copy link
Author

I see. mvnix-update sets -E '(import "/some/path/default.nix" {}).overrideAttrs (_: { build = false; })'.
That leaves me confused however. If that's disabled, why and how does maven build?

-> The answer is that this is being run in a nix shell and it's just getting the appropriate environment. I should probably be patching the src derivation.

@ajs124
Copy link

ajs124 commented Apr 22, 2020

I dirty/shitty hack is to override the buildPhase.

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