Java 9 - Can I add the MainClass attribute to module-info.class in the archive?

2017-01-24 Thread Eric Kolotyluk

In Java 9, you can create a JAR file with

jar --create --file=mlib/com.greetings.jar --main-class=com.greetings.Main -C 
mods/com.greetings .


Which has the side effect of adding the MainClass attribute to the 
module-info.class file in the .jar file.


Do any of the plugins support this yet, or do I need to invoke the Java 
9 'jar' command directly?


Is this the right forum to be asking these questions, or should I go to 
StackOverflow or somewhere else?


Cheers, Eric


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Excluding -beta-N from a range

2017-01-24 Thread Lukasz Dywicki
a range like: 

[1.min,1.max]

Includes 1.0.0-SNAPSHOT and excludes 2.0.0-SNAPSHOT with everything what is
in 1.x (not sure about upper bound and 1.9-rc, beta etc).

Kind regards,
Lukasz
--
Apache Karaf Committer & PMC
Twitter: @ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org



--
View this message in context: 
http://maven.40175.n5.nabble.com/Excluding-beta-N-from-a-range-tp5892806p5894368.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Custom range resolver

2017-01-24 Thread Ɓukasz Dywicki
I been digging with my collegue aroudn maven ranges for some time and
we reached point where we would like to customize them. Because we are
using OSGi and maven resolver embedded in Karaf (which is also aether
based) and also some version ranges in XML descriptors (which are
interpreted as osgi ranges) we ended up having a certain gap. The
major problem is lower and upper bound inclusion/excllusion. As found
in ealier mails from this month 2.0.0-SNAPSHOT is smaller than 2.0.0
meaning it is included in [1,2) range. I managed to get rid of this
inclusion by using 1.max bound: [1,1.max], but then 1.0.0-SNAPSHOT is
not in the range. To avoid that I did [1.min, 1.max] range. So far so
good, but lower and upper bound in osgi will not work. When I will
install 1.0.0.SNAPSHOT (which is 1.0.0-SNAPSHOT in maven) it will not
match 1.0.0.min range because osgi treats qualifier with "startsWith"
logic. It is not aware of what snapshot means, for osgi framework its
just a string sequence.

I know ranges in build might be wrong, but I know how to use them and
I use them together with osgi so I am sure my build results will
match.

I managed to complete a code which embeds osgi range resolution inside
aether's VersionRangeResolver implementation. It is straight forward,
covered by simple tests and works as expected. Even if its not working
as expected it can be found by unit tests and fixed. What is hardest
for me now is binding this resolver into build so maven's
implementation of VersionRangeResolver gets replaced by mine. For this
reason I created .mvn/extensions.xml inside project root with my
artifact id:




org.code-house.maven
osgi
3.3.9-SNAPSHOT



During launch with verbose output I see my extension loaded:
[DEBUG] org.code-house.maven:osgi:jar:3.3.9-SNAPSHOT:
[DEBUG]org.apache.maven:maven-core:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-model:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-settings:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-settings-builder:jar:3.3.9:compile
[DEBUG]  org.apache.maven:maven-builder-support:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-repository-metadata:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-artifact:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-plugin-api:jar:3.3.9:compile
[DEBUG]   org.apache.maven:maven-model-builder:jar:3.3.9:compile
[DEBUG]   org.eclipse.aether:aether-util:jar:1.0.2.v20150114:compile
[DEBUG]   org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2:compile
[DEBUG]  javax.enterprise:cdi-api:jar:1.0:compile
[DEBUG] javax.annotation:jsr250-api:jar:1.0:compile
[DEBUG]  org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.2:compile
[DEBUG]   com.google.inject:guice:jar:no_aop:4.0:compile
[DEBUG]   org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:3.0.22:compile
[DEBUG]   org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[DEBUG]   org.codehaus.plexus:plexus-component-annotations:jar:1.6:compile
[DEBUG]   org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]  org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]   org.apache.commons:commons-lang3:jar:3.4:compile
[DEBUG]org.eclipse.aether:aether-api:jar:1.0.2.v20150114:compile
[DEBUG]org.eclipse.aether:aether-impl:jar:1.0.2.v20150114:compile
[DEBUG]   org.eclipse.aether:aether-spi:jar:1.0.2.v20150114:compile
[DEBUG]com.google.inject:guice:jar:4.0:compile
[DEBUG]   javax.inject:javax.inject:jar:1:compile
[DEBUG]   aopalliance:aopalliance:jar:1.0:compile
[DEBUG]   com.google.guava:guava:jar:16.0.1:compile
[DEBUG]org.osgi:org.osgi.core:jar:6.0.0:compile
[DEBUG]org.slf4j:slf4j-log4j12:jar:1.7.22:compile
[DEBUG]   org.slf4j:slf4j-api:jar:1.7.22:compile
[DEBUG]   log4j:log4j:jar:1.2.17:compile

Extension gets initialized as well:
[DEBUG] Extension realms for project
com.example.web:model:bundle:4.0.0-SNAPSHOT:
[ClassRealm[extension>org.code-house.maven:osgi:3.3.9-SNAPSHOT,
parent: sun.misc.Launcher$AppClassLoader@18b4aac2],
ClassRealm[extension>org.apache.felix:maven-bundle-plugin:3.2.0,
parent: sun.misc.Launcher$AppClassLoader@18b4aac2]]
[DEBUG] Created new class realm project>com.example.web:model:4.0.0-SNAPSHOT
[DEBUG] Populating class realm project>com.example.web:model:4.0.0-SNAPSHOT
[DEBUG] Looking up lifecyle mappings for packaging bundle from
ClassRealm[project>com.example.web:model:4.0.0-SNAPSHOT, parent:
ClassRealm[maven.api, parent: null]]
[DEBUG] Extension realms for project
com.example.web:parent:pom:4.0.0-SNAPSHOT:
[ClassRealm[extension>org.code-house.maven:osgi:3.3.9-SNAPSHOT,
parent: sun.misc.Launcher$AppClassLoader@18b4aac2],
ClassRealm[extension>org.apache.felix:maven-bundle-plugin:3.2.0,
parent: sun.misc.Launcher$AppClassLoader@18b4aac2]]
[DEBUG] Looking up lifecyle mappings for packaging pom from