Skip to content

Implemented @DefaultActivationStrategy feature#141

Merged
chkal merged 1 commit into
togglz:masterfrom
KaiHofstetter:default_activation_strategy
Oct 19, 2015
Merged

Implemented @DefaultActivationStrategy feature#141
chkal merged 1 commit into
togglz:masterfrom
KaiHofstetter:default_activation_strategy

Conversation

@KaiHofstetter
Copy link
Copy Markdown
Contributor

Hi Christian,

just implemented @DefaultActivationStrategy feature, like discussed...

public enum MyFeatures implements Feature {

    @EnabledByDefault
    @DefaultActivationStrategy(
        id = UsernameActivationStrategy.ID,
        parameters = {
            @ActivationParameter(name = UsernameActivationStrategy.PARAM_USERS, value = "person1,ck,person2")
        }
    )
    FEATURE_ONE;

}

Thanks,
Kai

@KaiHofstetter
Copy link
Copy Markdown
Contributor Author

I just saw that I accidentally commited my pom.xml changes.
I had problems running mvn -DJBOSS_REPO=true clean install.
The bundlor maven plugin stopped with a NoClassDefFoundError:

...
[INFO] --- org.eclipse.virgo.bundlor.maven:1.1.2.RELEASE:bundlor (bundlor) @ togglz-project ---
[WARNING] Error injecting: org.eclipse.virgo.bundlor.maven.plugin.BundlorMojo
java.lang.NoClassDefFoundError: org/eclipse/virgo/bundlor/support/manifestwriter/ManifestWriterFactory
...

I had to add following dependencies to the bundlor maven plugin:

...
<plugin>
    <groupId>org.eclipse.virgo.bundlor</groupId>
    <artifactId>org.eclipse.virgo.bundlor.maven</artifactId>
    ...
    <dependencies>
        <dependency>
            <groupId>org.eclipse.virgo.bundlor</groupId>
            <artifactId>org.eclipse.virgo.bundlor</artifactId>
            <version>1.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.virgo.bundlor</groupId>
            <artifactId>org.eclipse.virgo.bundlor.blint</artifactId>
            <version>1.1.2.RELEASE</version>
        </dependency>
    </dependencies>
</plugin>
...

It does not surprise me, that it did not compile, since the pom.xml of the bundlor maven plugin uses the scope provided for those two dependencies:

...
<dependency>
    <groupId>org.eclipse.virgo.bundlor</groupId>
    <artifactId>org.eclipse.virgo.bundlor</artifactId>
    <version>${project.version}</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.eclipse.virgo.bundlor</groupId>
    <artifactId>org.eclipse.virgo.bundlor.blint</artifactId>
    <version>${project.version}</version>
    <scope>provided</scope>
</dependency>
... 

I don't seem to be the only person, who had that problem: #129

Regards,
Kai

@chkal
Copy link
Copy Markdown
Member

chkal commented Oct 12, 2015

Awesome! Thanks a lot. I'll try to find some time in the next days to review that patch. Unfortunately I'm very busy at the moment. So it may take some days..

chkal added a commit that referenced this pull request Oct 19, 2015
Implemented @DefaultActivationStrategy feature
@chkal chkal merged commit 2c84aea into togglz:master Oct 19, 2015
@chkal
Copy link
Copy Markdown
Member

chkal commented Oct 19, 2015

Thanks a lot. This looks great! I just added some more javadocs for the annotations. And I set a default value for the parameters so that users can omit the parameters if they don't want to set any (Not sure if this happens though).

See: ac6d5fd

Thanks again for the contribution!

@KaiHofstetter
Copy link
Copy Markdown
Contributor Author

No problem. Thank you for accepting my pull request!

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