maven-2

Maven - lookup dependencies at runtime

China☆狼群 提交于 2021-02-19 02:50:33
问题 I would like to be able to determine what versions I am running of a dependency at runtime as well as the version of the web application itself. Each web application I deploy is packaged with a pom.xml which I can read from, that part is trivial. The next part is parsing the pom without much effort. As the web application is running, I want to be able to understand what version I am, and what versions my dependencies are. Ideally, I would like to do something like: MavenPom pom = new MavenPom

Starting of the Apache tomcat server before integration test

故事扮演 提交于 2021-02-18 12:38:28
问题 I've been looking for an solution for the last 4 days and raised this question as a bounty but still not getting my answer. Where i've succeeded with the help pf pom.xml file:- a) Starting the tomcat server manually using command i.e mvn tomcat7:run. This command also help me deploying of my war file to tomcat server and starting the server. b) Running my integration tests using testng.xml file configuration on eclipse. Where i'm failed with the help pf pom.xml file:- a) Automatically

Maven Quick-start Guide [closed]

陌路散爱 提交于 2021-02-18 10:20:15
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Improve this question I'm tasked with getting a development environment set up for a new program at work. The lead has chosen Eclipse as the IDE for its OSGi support and Maven as the build utility. I've struggled through getting Maven integrated with Eclipse and I'm grudgingly

Maven profiles in pom

老子叫甜甜 提交于 2021-02-11 18:24:40
问题 I am trying to set some system environment variables through maven, based on profiles. So my pom code is <profile> <id>dev</id> <activation> <property> <name>com.xxx.profile</name> <value>dev</value> </property> </activation> <properties> <db-url>jdbc:postgresql://abc</db-url> <db-username>xxx</db-username> <db-pwd>yy</db-pwd> </properties> </profile> So when I build the project, I do mvn clean install -Dcom.xxx.profile=dev In the code, I have String urlDB = System.getProperty("db-url");

How to put a jar in mvnrepository.com?

半世苍凉 提交于 2021-02-08 12:18:00
问题 I created a small open source Java library LinkSet and I'd like to put it into mvnrepository.com. How to do it? There is nothing like "upload/log in/sign in" link on this website :( 回答1: Guide to uploading artifacts to the Central Repository 回答2: As far as I know, mvnrepository is only linked to the Maven 2 central repository. This mean that it automatically retrieve new or updated libraries that are present in this repository. In others words, your library must be present in the official

How to put a jar in mvnrepository.com?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 12:17:11
问题 I created a small open source Java library LinkSet and I'd like to put it into mvnrepository.com. How to do it? There is nothing like "upload/log in/sign in" link on this website :( 回答1: Guide to uploading artifacts to the Central Repository 回答2: As far as I know, mvnrepository is only linked to the Maven 2 central repository. This mean that it automatically retrieve new or updated libraries that are present in this repository. In others words, your library must be present in the official

what is this maven certification error indicates?

大憨熊 提交于 2021-02-08 08:27:19
问题 [ERROR] Non-resolvable parent POM for com.example:dynamoWork:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.1.0.RELEASE from/to artie (https://repo.maven.apache.org/maven2/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at no local POM @ line 14, column 10 ->

Name the root directory of project generated with Maven Archetype

↘锁芯ラ 提交于 2021-02-08 01:49:07
问题 How can I control the name of the top directory of the maven module created by my maven archetype? Currently it creates a new folder named $artifactId . Or even more directly, is there a way that my archetype can create a folder named after the module's artifactId, but with dashes replaced by underscores? 回答1: The naming convention for artifactId's is to use dashes (hyphens). I don't think there is any way to make the module's directory named something other than the artifactId. That being

How to get the values of server defined in the settings.xml to use them in my pom.xml?

寵の児 提交于 2021-02-07 06:14:01
问题 I know I can retrieve some settings.xml parameters using properties, like, for example ${settings.localRepository} to get the location of the local repository. Now imagine my settings.xml contains the following servers definition: <servers> <server> <id>server-dev</id> <username>devuser</username> <password>devpass</password> </server> <server> <id>server-hom</id> <username>homuser</username> <password>hompass</password> </server> </servers> Is there a way, given an id of a server to get the

How to get the values of server defined in the settings.xml to use them in my pom.xml?

穿精又带淫゛_ 提交于 2021-02-07 06:13:26
问题 I know I can retrieve some settings.xml parameters using properties, like, for example ${settings.localRepository} to get the location of the local repository. Now imagine my settings.xml contains the following servers definition: <servers> <server> <id>server-dev</id> <username>devuser</username> <password>devpass</password> </server> <server> <id>server-hom</id> <username>homuser</username> <password>hompass</password> </server> </servers> Is there a way, given an id of a server to get the