Well, still no luck.
I added my common-module as a dependency in the service-module, but when
I build the package I get
[ERROR] Failed to execute goal on project intersystem-service: Could not
resolve dependencies for project
com.kodak.intersystem:intersystem-service:jar:0.0.1-SNAPSHOT: Failed to
collect dependencies for
[de.uni_leipzig:wortschatz_webservice_client_sachgebiet:jar:1.0
(compile), jivesoftware:whack-dist:jar:1.0 (compile),
jivesoftware:smackx-jingle:jar:3.1.0 (compile),
com.kodak.intersystem:intersystem-common:jar:0.0.1-SNAPSHOT (runtime),
info.collide:sqlspaces-client:jar:3.9.1 (compile),
org.hibernate:hibernate-core:jar:3.6.1.Final (compile),
org.eclipse.jetty:example-jetty-embedded:jar:8.0.0.M2 (compile),
org.jboss.logging:jboss-logging-log4j:jar:2.1.2.GA (compile),
org.slf4j:slf4j-log4j12:jar:1.6.1 (compile),
net.jcip:jcip-annotations:jar:1.0 (compile),
postgresql:postgresql:jar:9.0-801.jdbc4 (compile),
org.modeshape:modeshape-sequencer-jbpm-jpdl:jar:jar-with-dependencies:2.2.0.Final
(compile), org.javassist:javassist:jar:3.14.0-GA (compile),
com.sun.org.apache:jaxp-ri:jar:1.4 (compile),
com.miglayout:miglayout:jar:3.7.4 (compile),
com.jidesoft:jide-oss:jar:2.4.8 (compile)]: Failed to read artifact
descriptor for
com.kodak.intersystem:intersystem-common:jar:0.0.1-SNAPSHOT: Failure to
find com.kodak.intersystem:Kodak-Intersystem:pom:0.0.1-SNAPSHOT in
https://repository.jboss.org/nexus/content/repositories/releases/ was
cached in the local repository, resolution will not be reattempted until
the update interval of org.jboss.repository has elapsed or updates are
forced -> [Help 1]
If I remove the dependency to the common-module then the build works,
but does not include the class files from the common-module in the uber-jar.
Does anyone have any other ideas of what to try?
Cheers, Eric
On 2011-05-03 12:51 PM, Eric Kolotyluk wrote:
More below...
On 2011-05-03 9:14 AM, Wayne Fay wrote:
Anyway, shade is doing mostly what I want, except I cannot seem to
configure
it to include classes from a sibling module in Maven.
If you have it set up as a dependency, it should "just work."
Except that then Maven complains it cannot find the repository that it
is in.
My structure is something like
parent/pom.xml
service-module/pom.xml
common-module/pom.xml
client-module/pom.xml
It is not clear to me if your parent directory is a sibling of
service-module and the others and thus all the pom.xml files are on
the same "level." If so, this is not how I would generally expect it
to be set up. Instead, you would have a parent directory and then
inside of that you would have the various modules.
So, I had to flatten my Eclipse projects because I am using IBM
Rational Team Concert for SCM and it does not yet support nested
projects the way Maven likes them. Consequently I followed the Maven
documentation to "flatten" my projects on the file system. For the
most part Maven seems happy with that - but maybe not in this case
To be clear - parent/pom.xml is a POM project, and
service-module/pom.xml, common-module/pom.xml and
client-module/pom.xml are all modules of parent/pom.xml as well as
being JAR projects. The directories parent, service-module,
common-module and client-module are all siblings because they were
flattened.
I want the service-module.jar to contain the classes from
common-module, but
can't figure out how. I tried putting the coordinates of
common-module into
my service-module/pom.xml, but Maven complains because it cannot find
common-module in any repository.
First, you are probably not running from the parent. This should work
if you are running from the parent and have your multimodule project
set up properly.
When I tried running from the parent Maven threw a
NullPointerException. I found an article somewhere where other people
had this same problem. There was some advice there, but I have not got
back to researching it further. Maybe I just need to configure the
parent POM properly?
Second, you can get around this by running "mvn install" in
common-module, and then try building the shaded jar in service-module
again. It will use the jar contents that are in your local repo cache,
not from the sibling directory.
OK, that makes sense - I will try that after my system backup finishes.
Hopefully you are using snapshot versions while sorting out these
issues. Versions are important and it is typical for someone new to
Maven to not fully appreciate that once versioned (with anything
except a Snapshot version), an artifact must never change. Versioned
artifacts are immutable in Maven.
Yes, I still have not moved off of my first snapshot - I'm really a
Maven newbie :-)
"Versioned artifacts are immutable in Maven." That sounds serious? Can
I take that to mean that you typically version a project after it has
been released because you are never going to change it again? If you
changed it then it would be another version wouldn't it?
As it is, I don't even know how to change the version yet.
Wayne
Thanks for all the advice.
Cheers, Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]