reference.conf and Maven

706 views
Skip to first unread message

Peter Wolf

unread,
Mar 21, 2014, 5:09:53 PM3/21/14
to akka...@googlegroups.com
Hello I am getting stuck on building Actors with Maven

I would like to bundle everything into a single JAR.  But when I do this, Akka code can no longer find the reference.conf files from the libraries.

I am using the net.alchim31.maven scala-maven-plugin and  marking all dependencies as "compile"

What is the recommended way to build Akka with Maven?

Thanks
Peter              


√iktor Ҡlang

unread,
Mar 21, 2014, 5:13:30 PM3/21/14
to Akka User List

Hi Peter,

May I interest you in reading the documentation?

http://doc.akka.io/docs/akka/2.3.0/general/configuration.html#When_using_JarJar__OneJar__Assembly_or_any_jar-bundler

Cheers,
V

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Peter Wolf

unread,
Mar 21, 2014, 5:25:29 PM3/21/14
to akka...@googlegroups.com

Thank you Victor,

Yes I had read that documentation, and I do have the shade plugin in my pom.xml

Unfortunately, it does not seem to work :-(

Here is my settings for it...

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>allinone</shadedClassifierName>
                            <artifactSet>
                                <includes>
                                    <include>*:*</include>
                                </includes>
                            </artifactSet>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>reference.conf</resource>
                                </transformer>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Main-Class>akka.Main</Main-Class>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>

 

Peter Wolf

unread,
Mar 21, 2014, 5:32:23 PM3/21/14
to akka...@googlegroups.com
But reading it again...  It seems to recommend that I manually create a reference.conf that is a merge of those from all the libraries.

Is that really all that shade does?

√iktor Ҡlang

unread,
Mar 21, 2014, 5:50:56 PM3/21/14
to Akka User List
Hi Peter,

I do not use Maven, and I unfortunately cannot foresee what "does not work" actually yields.
Have you searched the mailing list archives for answers?


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,

———————
Viktor Klang
Chief Architect - Typesafe

Twitter: @viktorklang

Peter Wolf

unread,
Mar 21, 2014, 9:06:23 PM3/21/14
to akka...@googlegroups.com
Thanks for the help Victor, I think I got it

I created my own reference.conf which is just all the reference.conf from each library appended together.  I put that reference.conf in my resource directory.

So far, it seems to work, but I'll have to remember to recreate it when I upgrade to new libraries

P

Patrik Nordwall

unread,
Mar 23, 2014, 4:50:19 AM3/23/14
to akka...@googlegroups.com
If I understand it correctly; maven Shade plugin provides the capability of packaging an application with all dependencies into one fat jar. It also provides the capability to transform resources, in this case merging reference.conf files.

/Patrik
 

P

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Typesafe Reactive apps on the JVM
Twitter: @patriknw

Reply all
Reply to author
Forward
0 new messages