pom.xml error in eclipse(indigo) when creating jboss-as-helloworld project - eclipse

I have a problem when i create jboss-as-helloworld project and it first gives quick fix dialog box.
project build error non-resolvable import POM: failure to transfer org.jboss.spec:jboss-javaee-6.0:pom:3.0.0.beta1 from http:\\repo1.maven2 was cashed in the local repository,resolution will not be reattempted until the update interval of central
Project build error:'dependencies.dependency.version'for javax.enterprise:cdi-api:jar is missing.
Project build error:'dependencies.dependency.version'for org.jboss.spec.javax.annotation:jboss-annotation-api_1.1_spec:jar is missing.
Project build error:'dependencies.dependency.version'for org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar is missing.
It gives this errors when it start to run..
[INFO] Scanning for projects...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http:\\www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Downloading: http:\\repo1.maven.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.0.Beta1/jboss-javaee-6.0-3.0.0.Beta1.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-helloworld:7.1.1-SNAPSHOT (C:\Users\Heshan\workspace\helloworld\jboss-as-helloworld\pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not transfer artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.0.Beta1 from/to central (http://repo1.maven.org/maven2): Connect times out # line 39, column 22 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for javax.enterprise:cdi-api:jar is missing. # line 53, column 19
[ERROR] 'dependencies.dependency.version' for org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar is missing. # line 61, column 19
[ERROR] 'dependencies.dependency.version' for org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar is missing. # line 69, column 19
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http:\\cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http:\\cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
[INFO] Scanning for projects...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http:\\www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Downloading: http:\\repo1.maven.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.0.Beta1/jboss-javaee-6.0-3.0.0.Beta1.pom.
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-helloworld:7.1.1-SNAPSHOT (C:\Users\Heshan\workspace\helloworld\jboss-as-helloworld\pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not transfer artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.0.Beta1 from/to central (http://repo1.maven.org/maven2): Connect times out # line 39, column 22 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for javax.enterprise:cdi-api:jar is missing. # line 53, column 19
[ERROR] 'dependencies.dependency.version' for org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar is missing. # line 61, column 19
[ERROR] 'dependencies.dependency.version' for org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar is missing. # line 69, column 19
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http:\\cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http:\\cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Non-resolvable import POM: Could not transfer artifact
org.jboss.spec:jboss-javaee-6.0:pom:3.0.0.Beta1 from/to central
(http://repo1.maven.org/maven2): Connect times out # line 39, column
22 -> [Help 2
Your connection to maven central repo times out. You have a network connectivity issue. Maybe you don't have network connection, or maybe you need to configure a proxy if you do.
By using this link you can see the file actually is in there, so you should be able to download it.

Related

Maven dependency: import cannot be resolved but is present in local repository (Eclipse Oomph Unzip Setup Task)

I have problems using Maven.
A Maven mvn clean package of the submodule "task-unzip" from the Eclipse Oomph's Unzip Setup Task repository (https://github.com/maybeec/oomph-task-unzip) fails with the following error on several machines/setups:
[INFO] --- tycho-compiler-plugin:0.22.0:compile (default-compile) # com.github.maybeec.oomph.task.unzip ---
[INFO] Compiling 13 source files to C:\FOLDER\repositories\oomph-task-unzip\task-unzip\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.983 s
[INFO] Finished at: 2020-10-28T18:35:49+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project com.github.maybeec.oomph.task.unzip: Compilation failure: Compilation failure:
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[7]
[ERROR] import org.apache.commons.compress.archivers.ArchiveEntry;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[8]
[ERROR] import org.apache.commons.compress.archivers.ArchiveInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[9]
[ERROR] import org.apache.commons.compress.archivers.ArchiveStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[10]
[ERROR] import org.apache.commons.compress.compressors.CompressorInputStream;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[11]
[ERROR] import org.apache.commons.compress.compressors.CompressorStreamFactory;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[12]
[ERROR] import org.apache.commons.compress.utils.IOUtils;
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.commons cannot be resolved
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[47]
[ERROR] CompressorInputStream cIS = new CompressorStreamFactory().createCompressorInputStream(in);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] CompressorStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveInputStream cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[64]
[ERROR] ArchiveInputStream archiveIS = new ArchiveStreamFactory().createArchiveInputStream(fileIS);
[ERROR] ^^^^^^^^^^^^^^^^^^^^
[ERROR] ArchiveStreamFactory cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[65]
[ERROR] ArchiveEntry entry;
[ERROR] ^^^^^^^^^^^^
[ERROR] ArchiveEntry cannot be resolved to a type
[ERROR] C:\FOLDER\repositories\oomph-task-unzip\task-unzip\src\com\github\maybeec\oomph\task\unzip\core\impl\UnzipUtilImpl.java:[77]
[ERROR] IOUtils.copy(archiveIS, out);
[ERROR] ^^^^^^^
[ERROR] IOUtils cannot be resolved
[ERROR] 12 problems (12 errors)
[ERROR] -> [Help 1]
Maven is actually downloading the Apache commons-compress-1.19.jar to the local Maven repository and it is also being copied to the project's lib folder. So that is working and the dependency is actually present on the filesystem.
However, Maven can not find this dependency. Adding it manually to the project, the resolve failure can be solved, but that is not a solution to the problem it's not working with Maven.
Importing the submodule in Eclipse shows the same. Eclipse isn't able to auto-complete an "import" statement to "org.apache.commons.*":
The Properties > Build path of that submodule doesn't show any Maven dependencies (actually the "Maven Dependencies" list wasn't even there! I had to follow https://stackoverflow.com/a/27337064/5446400 and edit the .classpath file for that). However it's still empty:
Searching and working for hours on that problem I couldn't come up with an explanation why Maven behaves the way it does.
Thank you for any support!
Maven dependencies shouldn't need to be added to the build path of Eclipse plugins. The plugin dependencies are enough and in this case commons-compress-1.19.jar will be loaded as a library from within the plugin's lib directory (this is defined in the build.properties file), not directly as a Maven dependency.
I'm not sure if downloading a Maven dependency and using it in the same build will work this way. If it gets copied to the correct location, you might just need to refresh the workspace, otherwise the jar could get ignored in the Eclipse build.
For debugging the issue I would probably download the artifact and place the jar in the lib directory manually once and ditch the automated process. Then at least you see if this unusual handling of Maven dependencies is the issue or something else.

Compilation first rule

I downloaded the project 1_ MyFirst Custom Check. I've imported it into eclipse as a Maven project.
Using maven install I received the following error:
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/sonarsource/sonar-packaging-maven-plugin/sonar-packaging-maven-plugin/1.15/sonar-packaging-maven-plugin-1.15.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:jar:1.15 #
[ERROR] Unknown packaging: sonar-plugin # line 9, column 14
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.sonar.samples:java-custom-rules-template:1.0-SNAPSHOT (C:\Users\rmolano\Downloads\sonar-examples-master\plugins\tutorial\java-custom-rules-template\completed\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:jar:1.15: Could not transfer artifact org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:pom:1.15 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 2]
[ERROR] Unknown packaging: sonar-plugin # line 9, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
The truth that can not be put in the settings.xml in maven repo l .m2 folder, I tested with the following:
<settings>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>
http://localhost:9000
</sonar.host.url>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>sonar</activeProfile>
</activeProfiles>
</settings>
Sonarquebe installation is with the embedded database.
 
How I can make it compile? What would be the configuration settings for me down dependencies correctly?

I'm getting the following when trying to compile the Program

I am getting a mojofailure exception error.
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project maven-war-plugin: Compilation failure: Compilation failure:
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[42,25] error: package javax.servlet.http does not exist
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[43,25] error: package javax.servlet.http does not exist
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[92,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[93,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[117,3] error: cannot find symbol
[ERROR] \Users\admin\Desktop\Virtual_class\src\main\java\com\iws\controller\LoginController.java:[117,31] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I have seen this happen when you do not include the servlet-api.jar on your classpath. The servlet-api.jar is found in your container or application server.
For example, if you are running your application on Tomcat, be sure that tomcat is included on your classpath.

i want to build the developing environment of sakai oae on windows 7,but i don't know how to do it?

my OS is windows7.in the cmd, i run:
cd sakai3/3akai-ux
mvn clean install
i got:
[INFO] BUILD SUCCESS
then i run:
cd sakai3/nakamura
set MAVEN_OPTS="-Xmx256m -XX:PermSize=256m"
mvn clean install
i got this error:
[ERROR] Failed to execute goal org.apache.sling:maven-launchpad-plugin:2.1.0:pre
pare-package (prepare-package-jar) on project org.sakaiproject.nakamura.app: Una
ble to find artifact. Failure to find org.sakaiproject.nakamura:org.sakaiproject
.nakamura.ojdbc:jar:CURRENT-VERSION in http://repo1.maven.org/maven2/ was cached
in the local repository, resolution will not be reattempted until the update in
terval of maven repo has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.sakaiproject.nakamura -DartifactI
d=org.sakaiproject.nakamura.ojdbc -Dversion=CURRENT-VERSION -Dpackaging=jar -Dfi
le=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file t
here:
[ERROR] mvn deploy:deploy-file -DgroupId=org.sakaiproject.nakamura -DartifactId=
org.sakaiproject.nakamura.ojdbc -Dversion=CURRENT-VERSION -Dpackaging=jar -Dfile
=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] org.sakaiproject.nakamura:org.sakaiproject.nakamura.ojdbc:jar:CURRENT-VE
RSION
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] maven repo (http://repo1.maven.org/maven2/, releases=true, snapshots=fal
se),
[ERROR] apache-snapshots (http://repository.apache.org/snapshots/, releases=fals
e, snapshots=true),
[ERROR] sakai-releases (http://source.sakaiproject.org/maven2/, releases=true, s
napshots=false),
[ERROR] sakai-snapshots (http://source.sakaiproject.org/maven2-snapshots, releas
es=false, snapshots=true),
[ERROR] java.net (http://download.java.net/maven/2, releases=true, snapshots=fal
se),
[ERROR] modularity-releases (http://m2.modularity.net.au/releases, releases=true
, snapshots=false),
[ERROR] modularity-snapshots (http://m2.modularity.net.au/snapshots, releases=fa
lse, snapshots=true),
[ERROR] OPS4J (http://repository.ops4j.org/maven2, releases=true, snapshots=fals
e),
[ERROR] sonatype (https://oss.sonatype.org/content/repositories/releases/, relea
ses=true, snapshots=false),
[ERROR] sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/
snapshots, releases=false, snapshots=true),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=f
alse)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.sakaiproject.nakamura.app
then i install the org.sakaiproject.nakamura.ojdbc.jar use this command under the folder D:\sakai3\nakamura\contrib\oracle-jdbc:
mvn deploy:deploy-file -DgroupId=org.sakaiproject.nakamura -DartifactId=org.sakaiproject.nakamura.ojdbc -Dversion=1.4.2 -Dpackaging=jar -Dfile=ojdbc6.jar -Durl=url -DrepositoryId=repositoryId
mvn install:install-file -DgroupId=org.sakaiproject.nakamura -DartifactI
d=com.oracle-jdbc -Dversion=1.4.2 -Dpackaging=jar -Dfi
le=ojdbc6.jar
then i got a new error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project org.sakaiproject.nakamura.ojdbc: No transfe
r protocol found. -> [Help 1]
what should i do next???i have searched many website,but i haven't got a good idea.i don't know where i wrong or what i missing?
I an a chinese.please forgive my broken English.Thank you!
Your best bet is to ask on the Sakai OAE developers list.
But I believe the problem is the same as what I answered here.

Build Sling Failure: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test (default-integration-test)

im trying to build sling cause I need it for a project at the university. Can anyone tell me, how I can solve this error?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.112s
[INFO] Finished at: Sun Mar 25 18:51:41 CEST 2012
[INFO] Final Memory: 68M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test (default-integration-test) on project sling-servlet-archetype: Execution default-integration-test of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test failed: ${maven.home} is not specified as a directory: '/home/odin/Desktop/workspace/sling-builder/EMBEDDED'. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :sling-servlet-archetype
enter code here
I had the same issue with a project of my own - it seems to be an m2eclipse-issue, as it goes away when I use an external maven instead of the embedded one m2eclipse uses by default.
its m2e-embedded mvn setting a bogus maven.home-dir
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341120
only known workaround (as mentioned above) is to use an external mvn