Skip to content

Conversation

@ASzc
Copy link
Contributor

@ASzc ASzc commented Nov 20, 2017

Symlinks are frequently unavailable on Windows (must be on NTFS and user must
have SeCreateSymbolicLinkPrivilege). Removing the symlinks for licenses/common/
should enable the build to function mostly normally on Windows. The individual
license files will be incorrect, but that shouldn't matter for local builds.
Release builds are done on *nix.

The plugin rolls several different plugin executions into one. The common files
are distributed using a resource jar, used by and unpacked by the plugin.

@ssilvert
Copy link
Contributor

You can't do a clean on this. If I do mvn clean in the /distribution directory, I will get:

[ERROR] Plugin org.keycloak:keycloak-distribution-licenses-maven-plugin:3.4.1.Final-SNAPSHOT or one of its dependencies could not be resolved: Failure to find org.keycloak:keycloak-distribution-licenses-maven-plugin:jar:3.4.1.Final-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced -> [Help 1]

Looks like you need to make sure your license jar gets built first.

BTW, don't tell anyone I'm doing work today. It's a holiday here in the US. :-)

@ASzc
Copy link
Contributor Author

ASzc commented Nov 24, 2017

Thanks Stan. I can reproduce the issue when I delete the plugin from my local repo.

keycloak-distribution-licenses-maven-plugin is configured to build, and it is in the reactor when building from the distribution directory. In fact, if you check your log, you'll see "Keycloak Licenses Processor Maven Plugin" right before the failure. However, in the clean lifecycle the plugin obviously isn't going to be built, as the only phases are pre-clean, clean, and post-clean. What's pretty stupid on maven's part is that it's still trying to load keycloak-distribution-licenses-maven-plugin even though it's not bound to any of these phases!

I know I can explicitly tell maven not to load a plugin if I bind it to phase none. An automatically activated profile might be viable if I can detect the clean lifecycle. I'll see...

@ASzc
Copy link
Contributor Author

ASzc commented Nov 24, 2017

Ok, I think I found the issue. Maven was acting stupidly because I wasn't giving it enough information. It can't tell what the default phase of a plugin is without loading it, and the definition I wrote relied on the default phase. By specifying an explicit phase in the definition, maven can know immediately that that phase is not contained in the clean lifecycle, and therefore it can skip loading the plugin.

Also, it seems very difficult to activate a profile automatically on a certain lifecycle. The only way seems to be if there's a certain property or property/value combination that's unique to that lifecycle.

… symlinks

Symlinks are frequently unavailable on Windows (must be on NTFS and user must
have SeCreateSymbolicLinkPrivilege). Removing the symlinks for licenses/common/
should enable the build to function mostly normally on Windows. The individual
license files will be incorrect, but that shouldn't matter for local builds.
Release builds are done on *nix.

The plugin rolls several different plugin executions into one. The common files
are distributed using a resource jar, used by and unpacked by the plugin.
@ssilvert
Copy link
Contributor

So where are we on this? Do we have something ready for me to look at again?

@ASzc
Copy link
Contributor Author

ASzc commented Nov 27, 2017

@ssilvert yes, it should now work for you if you try again, I force-pushed a new commit to replace the old one.

@ssilvert
Copy link
Contributor

Yep. Everything builds now. Ready for merge?

@ASzc
Copy link
Contributor Author

ASzc commented Nov 27, 2017

I think it's ready to merge, yes.

@ssilvert ssilvert merged commit c860ca6 into keycloak:master Nov 27, 2017
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

Successfully merging this pull request may close these issues.

2 participants