java - Maven install succeeds, but jar doesn't work correctly from bash (CLI) -
currently i'm working on project in company imports xml data our database. while doing rely on basic configuration projects have been created , used in other projects, i.e. entitymanagerbuilder
or other utility classes used in order create connection our oracle database. , seems me dependencies creating problems me.
my project runs fine if start within eclipse. , when create project mvn clean install -dskiptests
builds fine. when want run command line application starts , after few lines of code stops, without throwing errors or exceptions.
the reason why think has dependencies logging managed find point application stops. since stopped @ point investigate, did that. downloaded sources added logging , application had no problems @ class, instead stopped next static call other class.
i have no idea @ search error. since application has run self monthly task, executing eclipse not option.
hopefully can give me hint how solve this.
here pom:
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <groupid>com.company.infrastructure.foo</groupid> <artifactid>foo</artifactid> <version>1.0.0-snapshot</version> </parent> <artifactid>foo-import</artifactid> <packaging>jar</packaging> <name>fooimport</name> <properties> <company.consoleapp.main.class>com.company.infrastructure.foo.import.fooimporter</company.consoleapp.main.class> </properties> <dependencymanagement> <dependencies> <dependency> <groupid>com.company.maven</groupid> <artifactid>company-standalone-dm</artifactid> <version>${company.parent.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencymanagement> <dependencies> <!-- logging --> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> </dependency> <!-- utilities --> <dependency> <groupid>args4j</groupid> <artifactid>args4j</artifactid> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-impl</artifactid> <version>2.2.11</version> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-core</artifactid> <version>2.2.11</version> </dependency> <!-- using foo-dataaccess --> <dependency> <groupid>com.company.infrastructure.marken</groupid> <artifactid>foo-dataaccess</artifactid> <version>1.0.0-snapshot</version> <scope>compile</scope> </dependency> </dependencies> <build> <finalname>foo-import</finalname> <plugins> <!-- consoleapp-mixin --> <plugin> <groupid>com.github.odavid.maven.plugins</groupid> <artifactid>mixin-maven-plugin</artifactid> <configuration> <mixins> <mixin> <groupid>com.company.maven</groupid> <artifactid>company-consoleapp-mixin</artifactid> <version>${company.parent.version}</version> </mixin> </mixins> </configuration> </plugin> </plugins> </build>
i think might dependency management in maven, since haven't specified versions , maven figures out versions automatically.
however when run application, need jars in classpath otherwise might end getting classnotfoundexception because jars not available. unless figure out dependencies mentioned , add them classpath end seeing error.
it might worth enabling further level of logging in application give indication of error is. try , see if @ point of failure referenced external library, 1 not available in classpath.
could please share how running application through cli.
Comments
Post a Comment