Maven zależności

0

Witam, mam problem żeby dodać zależnośći do projektu javowego....
Projekt jest zmejwenizowany, pozostałe zależności OK, ale nie wiem jak dodać np.
Taką zależność JRE System Liblary[JavaSE-1.6], z automatu ustawi mi się 1.5 - probowałem

 
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.1</version>
	<configuration>
		<source>1.6</source> 
		<target>1.6</target> 
	</configuration>
</plugin> 

ale wywala mi błąd podczas mvn install:

.../.../../pom.xml: Unrecognised tag: 'configuration' (position: START_TAG seen ...</version>\n   \t\t<configuration>... @70:21)

Drugi problem to zależności do JBoss v5.0... podczas wyszkania w mavenie np.

<dependency>
  	<groupId>org.jboss.jbossas</groupId>
  	<artifactId>jboss-as-adminclient</artifactId>
  	<version>5.1.0.GA</version>
 </dependency>

to podczas dodawania zależności wyskakuje bląd żę takiego artefaktu nie można znaleźć....

ArtifactDescriptorException: Failed to read artifact descriptor for org.jboss.naming:jnp-client:jar:5.0.3.GA: ArtifactResolutionException: Failure to transfer org.jboss.naming:jnp-client:pom:5.0.3.GA from http://repository.jboss.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of repository.jboss.org has elapsed or updates are forced. Original error: Could not transfer artifact org.jboss.naming:jnp-client:pom:5.0.3.GA from/to repository.jboss.org (http://repository.jboss.org/maven2): Access denied to http://repository.jboss.org/maven2/org/jboss/naming/jnp-client/5.0.3.GA/jnp-client-5.0.3.GA.pom. Error code 403, Forbidden
0

Co do drugiej sprawy to generalnie repo JBossa wymaga zalogowania się.

Co do pierwszej to uzupełnij xmla o deklarację ns:

<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/maven-v4_0_0.xsd">
	

otwórz w Eclipse albo NB. Zobacz jakie błędy ci wskazuje parser XML>

0

Co do pierwszej sprawy: twoje uzupełnienie już tam się znajdowało - ja po prostu wyciełem tylko ten kawałek, ale teraz wydaje mi się że bląd może leżęc w tym żę nie zdefiniowałem pliku ejb-jar.xml - co o tym myślisz ?

Co do drugiej sprawy, jaka jest procedura logowania się do repo JBossa ?

0

ad 1. Może chodzi o inną konfigurację.

ad 2. powiem szczerze, że nie wiem, bo nigdy nie miałem konieczności. W innych repo wystarczy zdefiniować odpowiednie ustawienia w settings.xml u JBossa jest to inaczej. Zresztą po co korzystać z repo jbossa jak ten pakiet jest w głównym repo mavena? http://repo1.maven.org/maven2/org/jboss/jbossas/jboss-as-adminclient/

0
<repository> <id>jboss</id> https://repository.jboss.org/nexus/content/groups/public-jboss <snapshots> <enabled>false</enabled> </snapshots> </repository>

Nie trzeba sie logowac. Aczkolwiek jesli to czego szukasz jest w maven central to uzywaj cental.

0

Co do pierwszego bledu, masz tam jakiegos parenta czy cos do ktorego sie odwolujesz? Masz przeciez podana sciezke relatywnie do tego poma, a dalej linijke i kolumne chyba nawet gdzie wystepuje blad.

0

Co do pierwszego mojego zapytania: dodałem wszystko tak jak mówiłeś i mam taki błąd:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project DAOonlyLoak: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[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

0

A nawet jak dodam do settings.xml mavena żeby korzystał z repo jboss to i tak dostaje komunikat:

Missing artifact org.jboss.integration:jboss-transaction-spi:jar:5.1.0.GA 
0

Nie o to chodzi. W Settings.xml (obecnie settings-security.xml) można ustawić m.n. hasła. Wywal to repo stamtąd bo tylko będzie bruździć.

0

Ok, pierwszy problem - błachy problem, cos innego musiało mi przysłaniać rozwiązanie... wystarczyło dodać to co dodałem :)
Następnie chciałem zapytać o jakies konkretne hasła chodzi i czy tylko te user i passd ustawić a repo nie przypisywać ?

0

Wystarczy że dodam:

<repositories>
    <repository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Repository Group</name>
      <a href="http://repository.jboss.org/nexus/content/groups/public/">http://repository.jboss.org/nexus/content/groups/public/</a>
      <layout>default</layout>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Repository Group</name>
      <a href="http://repository.jboss.org/nexus/content/groups/public/">http://repository.jboss.org/nexus/content/groups/public/</a>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

i następnie

<settings>
  ...
  <servers>
    <server>
      <id>jboss-snapshots-repository</id>
      <username>jboss.org username</username>
      <password>jboss.org password</password>
    </server>
    <server>
      <id>jboss-releases-repository</id>
      <username>jboss.org username</username>
      <password>jboss.org password</password>
    </server>
  </servers>
  ...
</settings>

czy tyko to ostatnie ? i o jakie jboss.org username oraz jboss.org password chodzi ?

1 użytkowników online, w tym zalogowanych: 0, gości: 1