What am I missing?

64 views
Skip to first unread message

Ade

unread,
Jul 23, 2015, 7:17:18 AM7/23/15
to Jenkins Users
I have a maven based DropWizard project that builds a jar (including dependencies) perfectly from the terminal using "mvn assembly:single".

But when I try to build with Jenkins specifying "
mvn assembly:single" as a goal, source files from the main source folder i.e. "src/main/java"are missing from the jar.

my pom file includes -

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>test.App</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
        </plugins>
         <resources>
        <resource>
            <directory>src/main/java</directory>
        </resource>
    </resources>
    </build>
 
any ideas?

thanks

Ade

unread,
Jul 23, 2015, 7:20:33 AM7/23/15
to Jenkins Users, adrian.ha...@gmail.com
sorry forgot to include, using  -

Apache Maven 3.3.1
Java version: 1.8.0_51
Jenkins: 1.621

Baptiste Mathus

unread,
Jul 24, 2015, 2:50:28 AM7/24/15
to jenkins...@googlegroups.com

Freestyle or maven job?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9d32318c-aaba-48fb-9551-42f800a2ee07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ade

unread,
Jul 27, 2015, 1:30:26 PM7/27/15
to Jenkins Users, bma...@batmat.net
Maven, any ideas?

Vincent Latombe

unread,
Jul 28, 2015, 2:41:38 AM7/28/15
to Jenkins Users
Just a wild guess, but try to prepend ${project.basedir}/ to src/main/java.

Jenkins usually launches mvn using mvn -f <path to pom> whereas in local you usually launch maven directly in the project directory.

Vincent

Reply all
Reply to author
Forward
0 new messages