maven dependency unable to read lib from the dependency jar - maven-2

I have projects A & B where Project B is dependent on A. When I run mvn clean install in the command prompt, Project A compiles well and it produces the dependent jar for Project B in the maven local repository. During the compilation of Project B, I am getting a compilation error for a dependency listed in project B's POM. I have checked the classpath, versions and they are fine. The error I am seeing is mentioned below:
Project A
[INFO] Building tsscommon-ifc
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-ifc\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 455 source files to V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-ifc\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [jar:jar]
[INFO] Building jar: V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-ifc\target
\tsscommon-ifc-2.39.00-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-ifc\target\tsscommon-ifc-2.39.00-SNAPSHOT.jar to C:\Documents and Settings\pwvxd35\.m2\repository\us\mn\state\dhs\tss\common\tsscommon-ifc\2.39.00-SNAPSHOT\tsscommon-ifc-2.39.00-SNAPSHOT.jar
This is fine.
Project B
[INFO] Building tsscommon-server
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-server\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 137 source files to V:\dhs_tss_build_view\dhs_tssproject\tss\tsscommon-server\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/oblix/da/wsdl/OblixLoginAccess.java:[51,60] cannot find symbol
symbol : class BusinessException
location: class us.mn.state.dhs.tss.common.oblix.da.wsdl.OblixLoginAccess
Can anyone help with this issue?

The error is
OblixLoginAccess.java:[51,60] cannot find symbol
symbol : class BusinessException
location: class us.mn.state.dhs.tss.common.oblix.da.wsdl.OblixLoginAccess
This simply means that there is a class BusinessException referenced in the code for OblixLoginAccess at line 51, character 60.
The symbol cannot be found on the compile classpath.
This may or may not have anything to do with dependencies of Project B on Project A. You need to find out where that class is supposed to be, and make sure it is there.

Related

How to get 'mvn lagom:runAll' to get my service listening on a port?

I was having problems getting my first service to run and decided to add the hello-api and hello-impl projects from the lagom Maven archtype project to see if it would work. It did but mine do not.
Background
Since other team members are pure Java developers, I was trying to avoid leveraging sbt and activator. Thus, the objective is that everything works in maven.
Here's a snippet of the 'mvn install' script output to show the other services built.
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api <======= WANT THE SERVICE FOR THIS ONE TO RUN
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Archetype - mai-svcs ............................... SUCCESS [ 2.774 s]
[INFO] mai-svc-common ..................................... SUCCESS [ 7.190 s]
[INFO] mai-actors-api ..................................... SUCCESS [ 24.706 s]
[INFO] mai-namespace-api .................................. SUCCESS [ 12.628 s]
[INFO] mai-actors-impl .................................... SUCCESS [ 29.061 s]
[INFO] mai-namespace-impl ................................. SUCCESS [ 21.294 s]
[INFO] mai-i18n-phrases-api ............................... SUCCESS [ 22.091 s]
[INFO] hello-api .......................................... SUCCESS [ 3.546 s]
NOTES: An MAIActorsModule class analogous to the HelloModule class was created and the application.conf file added in the src/main/resources folder.
When the command 'mvn lagom:runAll' is issued, initially, the services are the hello service port is logged but no other service's port is.
$ mvn lagom:runAll
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- lagom-maven-plugin:1.2.1:runAll (default-cli) # mai-svcs ---
[INFO] Starting Kafka
[INFO] Starting Cassandra
.[INFO] Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
....[INFO] Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
[INFO] New Cassandra host /127.0.0.1:4000 added
[INFO] Cassandra server running at 127.0.0.1:4000
[INFO] Service locator is running at http://localhost:8000
[INFO] Service gateway is running at http://localhost:9000
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lusp\mai_svcs\mai-svcs\hello-api\src\main\resources
[INFO] Nothing to compile - all classes are up to date
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
**[INFO] Nothing to compile - all classes are up to date
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797
// ----- NO ENTRY FOR mai-actors-impl!!! -----
[INFO] (Service started, press enter to stop and go back to the console...)**
What step(s) did I miss?
Each of your <service>-impl projects need to:
Invoke the lagom-maven-plugin
Configure it with the property <lagomService>true</lagomService>
Here's an example snippet of what you need to add to your pom.xml file in each service implementation project:
<build>
<plugins>
<plugin>
<groupId>com.lightbend.lagom</groupId>
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
</configuration>
</plugin>
</plugins>
</build>
The Lagom documentation has more details in the page titled Defining a Lagom build

Getting start with Maven

I am very new to Maven.I have installed the maven on my local machine.
After installation for trial basis i was trying to execute mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
for that i am getting below error message.
C:\work\maven2.2\bin>mvn archetype:generate -DarchetypeGroupId=org.apache
.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: repo1.ma
ven.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Aug 30 11:45:49 IST 2011
[INFO] Final Memory: 1M/59M
[INFO] ------------------------------------------------------------------------
Can any one help me if i need to have a prerequisite setting for the same?
Thanks in advance. :)
It's comand is correct and on my computer run correctly. But you have Error transferring file. So on this branch you may read about this error.
EDIT:
Tutorials:
First of all read this article : maven in 5 minutes
For more information : Maven Getting Started Guide
The second article will give you all you need to understend maven.

Maven adds '-windows' to the artifact name when downloading a snapshot artifact

I have added a bunch of artifacts to my local Nexus Maven repository.
When I build my project I get the following error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building pronto-web Java EE 6 Webapp
[INFO] task-segment: [verify]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Source\Pronto\pronto\pronto-web\target\classes
[INFO] [antrun:run {execution: remove-javax}]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [gwt:compile {execution: default}]
[INFO] using GWT jars from project dependencies : 20100714-SNAPSHOT
[WARNING] You should not declare gwt-dev as a project dependency. This may introduce complex dependency conflicts
Downloading: http ://mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] artifact not found - Unable to locate resource in repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.google.gwt -DartifactId=gwt-dev -Dversion=20100714-20100715.053026-1 -Dclassifier=windows -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.gwt -DartifactId=gwt-dev >-Dversion=20100714-20100715.053026-1 -Dclassifier=windows -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
com.google.gwt:gwt-dev:jar:20100714-20100715.053026-1
from the specified remote repositories:
releases (http://mercury:8980/nexus/content/groups/public),
all (http://mercury:8980/nexus/content/groups/all),
snapshots (http://mercury:8980/nexus/content/groups/public-snapshots)
http ://mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Thu Jul 15 08:57:29 CEST 2010
[INFO] Final Memory: 50M/614M
[INFO] ------------------------------------------------------------------------
Has anyone an idea why maven thinks there should be '-windows' added to the artifact name?
(Downloading: http ://mercury:8980/nexus/content/groups/public-snapshots/com/google/gwt/gwt-dev/20100714-SNAPSHOT/gwt-dev-20100714-20100715.053026-1-windows.jar)
If I browse the repository it contains the artifact but without the '-windows' suffix.
Older versions of this artifact were platform dependent and had 'windows' or 'linux' or 'mac' as classifier but recent versions are platform independent and I don't have any such classifier in my poms.
PS:
I added a space in each URL between the protocol and the colon because I didn't yet receive enough reputation to post links.
The following dependency must be declared somewhere, very likely as a transitive dependency:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>20100714-SNAPSHOT</version>
<classifier>windows</classifier>
<dependency>
I suspect a bad pom if artifacts are not platform dependent anymore.
Is there any more recent snapshot you can use?

Maven2 problem to access plugins repository !

i just come to install maven2, after configuring the settings.xml in ${user.home}/.m2 and fixing a proxy error. Now by executing the command :
mvn -U archetype:create -DgroupId=maven-test -DartifactId=maven-test
-DpackageName=net.ensode.maventest
i get this error :
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Authorization failed: Access deni
ed to: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Apr 29 16:05:40 CEST 2010
[INFO] Final Memory: 2M/247M
[INFO] ------------------------------------------------------------------------
any idea of what could cause it ?
thanks !
I think that the most likely cause is that your proxy requires you to authenticate, and you haven't configured the authentication details into your settings.xml file.

Maven: Cannot get the help goals working (clean:help, compiler:help, etc)

I am new in Maven. Do you know what I am doing wrong (see below)?
mvn -e clean:help.
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'clean'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Required goal not found: clean:help in org.apache.maven.plugins:maven-clean-plugin:2.2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Required goal not found: clean:help in org.apache.maven.plugins:maven-clean-plugin:2.2
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1867)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
The version of the plugin you are using on the command line (2.2) does not have the clean:help goal (since 2.3). Try this instead:
mvn org.apache.maven.plugins:maven-clean-plugin:2.4:help
I think you want:
mvn help:describe -Dcmd=clean
which gives:
[INFO] [help:describe {execution: default-cli}]
[INFO] 'clean' is a lifecycle with the following phases:
* pre-clean: Not defined
* clean: org.apache.maven.plugins:maven-clean-plugin:clean
* post-clean: Not defined
See here for more details and examples. The same applies for compile.
mvn help:describe -Dcmd=compile